Improved feedparser performance

This commit is contained in:
daniel oeh
2012-06-25 12:56:01 +02:00
parent 703972e3c0
commit a974358f26
3 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,8 @@ import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.DateFormat;
import org.apache.commons.lang3.StringEscapeUtils;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateUtils;
@ -91,7 +93,7 @@ public class ItemviewActivity extends SherlockActivity {
url = URLEncoder.encode(item.getDescription(), "utf-8")
.replaceAll("\\+", " ");
} else {
url = URLEncoder.encode(item.getContentEncoded(), "utf-8")
url = URLEncoder.encode(StringEscapeUtils.unescapeHtml4(item.getContentEncoded()), "utf-8")
.replaceAll("\\+", " ");
}

View File

@ -35,6 +35,7 @@ import android.graphics.BitmapFactory;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import android.os.Binder;
import android.os.Debug;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
@ -270,7 +271,6 @@ public class DownloadService extends Service {
public void run() {
long imageId = 0;
boolean hasImage = false;
FeedManager manager = FeedManager.getInstance();
FeedHandler handler = new FeedHandler();
feed.setDownloaded(true);

View File

@ -29,7 +29,7 @@ public class NSContent extends Namespace {
@Override
public void handleElementEnd(String localName, HandlerState state) {
if (localName.equals(ENCODED)) {
state.getCurrentItem().setContentEncoded(StringEscapeUtils.unescapeHtml4(state.getContentBuf().toString()));
state.getCurrentItem().setContentEncoded(state.getContentBuf().toString());
}
}