Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (trimSize != null) {
- final String res = str.substring(0, trimSize)
- .replaceAll("<font color=\"(.*?)\">","<font color=\"#$1\">")
- .replaceAll("<a href=\"/(.*?)\" (\\w+)>(.*?)</a>", "<font color=\"#$2\"><a href=\"/$1\">$3</a></font>")
- .replace("<a href=\"t=0", "<a href=\"");
- runOnUiThread(new Runnable(){
- public void run(){
- try{
- portal.p2.setText(Html.fromHtml(res));
- portal.pd.cancel();
- } catch (Exception e) {
- Log.e("ERROR_PAGE", e.getMessage());
- }
- }
- });
- }
- if (str.startsWith("Size:")) {
- try{// set
- trimSize = Integer.parseInt(str.substring(5));
- Log.e("SIZE", ""+trimSize);
- } catch (Exception e) {
- Log.e("ERROR_SIZE", e.getMessage());
- }
- }else {// null
- trimSize = null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement