Advertisement
Guest User

Untitled

a guest
Oct 10th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1.      if (trimSize != null) {
  2.              final String res = str.substring(0, trimSize)
  3.                     .replaceAll("<font color=\"(.*?)\">","<font color=\"#$1\">")
  4.                   .replaceAll("<a href=\"/(.*?)\" (\\w+)>(.*?)</a>", "<font color=\"#$2\"><a href=\"/$1\">$3</a></font>")
  5.                   .replace("<a href=\"t=0", "<a href=\"");
  6.                              runOnUiThread(new Runnable(){
  7.                               public void run(){
  8.                                   try{
  9.                                       portal.p2.setText(Html.fromHtml(res));
  10.                                       portal.pd.cancel();
  11.                                 } catch (Exception e) {
  12.                                     Log.e("ERROR_PAGE", e.getMessage());
  13.                                 }
  14.                              }
  15.                             });
  16.                         }
  17.                          if (str.startsWith("Size:")) {
  18.                              try{// set
  19.                             trimSize = Integer.parseInt(str.substring(5));
  20.                             Log.e("SIZE", ""+trimSize);
  21.                          } catch (Exception e) {
  22.                                 Log.e("ERROR_SIZE", e.getMessage());
  23.                             }
  24.                         }else {// null
  25.                             trimSize = null;
  26.                         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement