Bug 856728 - TopSitesView.java executes a DB cursor on the main thread r=lucasr

This commit is contained in:
Mark Finkle 2013-04-02 20:22:25 -04:00
parent f6c6af821f
commit d95bb8a9a7

View File

@ -314,15 +314,15 @@ public class TopSitesView extends GridView {
if (urls.size() == 0)
return;
(new UiAsyncTask<Void, Void, Cursor>(ThreadUtils.getBackgroundHandler()) {
(new UiAsyncTask<Void, Void, Map<String, Bitmap> >(ThreadUtils.getBackgroundHandler()) {
@Override
public Cursor doInBackground(Void... params) {
return BrowserDB.getThumbnailsForUrls(cr, urls);
public Map<String, Bitmap> doInBackground(Void... params) {
return getThumbnailsFromCursor(BrowserDB.getThumbnailsForUrls(cr, urls));
}
@Override
public void onPostExecute(Cursor c) {
updateTopSitesThumbnails(getThumbnailsFromCursor(c));
public void onPostExecute(Map<String, Bitmap> thumbnails) {
updateTopSitesThumbnails(thumbnails);
}
}).execute();
}