mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 842374 - Use GeckoAsyncTask instead of AsyncTask when removing bookmarks r=kats
This commit is contained in:
parent
e3dae9a442
commit
08351e6873
@ -19,7 +19,6 @@ import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
@ -613,7 +612,7 @@ public class AwesomeBar extends GeckoActivity {
|
||||
break;
|
||||
}
|
||||
case R.id.remove_bookmark: {
|
||||
(new AsyncTask<Void, Void, Void>() {
|
||||
(new GeckoAsyncTask<Void, Void, Void>(GeckoApp.mAppContext, GeckoAppShell.getHandler()) {
|
||||
private boolean mInReadingList;
|
||||
|
||||
@Override
|
||||
|
@ -41,11 +41,17 @@ public abstract class GeckoAsyncTask<Params, Progress, Result> {
|
||||
}
|
||||
|
||||
public final void execute(final Params... params) {
|
||||
BackgroundTaskRunnable runnable = new BackgroundTaskRunnable(params);
|
||||
if (mPriority == Priority.HIGH)
|
||||
mBackgroundThreadHandler.postAtFrontOfQueue(runnable);
|
||||
else
|
||||
mBackgroundThreadHandler.post(runnable);
|
||||
mActivity.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
onPreExecute();
|
||||
|
||||
BackgroundTaskRunnable runnable = new BackgroundTaskRunnable(params);
|
||||
if (mPriority == Priority.HIGH)
|
||||
mBackgroundThreadHandler.postAtFrontOfQueue(runnable);
|
||||
else
|
||||
mBackgroundThreadHandler.post(runnable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public final GeckoAsyncTask<Params, Progress, Result> setPriority(Priority priority) {
|
||||
@ -54,6 +60,7 @@ public abstract class GeckoAsyncTask<Params, Progress, Result> {
|
||||
}
|
||||
|
||||
/* Empty stub method. Implementors can optionally override this if they need it */
|
||||
protected void onPreExecute() { }
|
||||
protected void onPostExecute(Result result) { }
|
||||
|
||||
protected abstract Result doInBackground(Params... params);
|
||||
|
Loading…
Reference in New Issue
Block a user