Bug 721776 - Don't remove bookmark from DB in the main thread (r=mfinkle)

This commit is contained in:
Lucas Rocha 2012-02-07 14:47:54 +00:00
Родитель 5a00f148ec
Коммит f79a1591e4
1 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -444,7 +444,7 @@ public class AwesomeBar extends Activity implements GeckoEventListener {
if (mContextMenuSubject == null)
return false;
String url = "";
final String url;
byte[] b = null;
String title = "";
if (mContextMenuSubject instanceof Cursor) {
@ -470,9 +470,19 @@ public class AwesomeBar extends Activity implements GeckoEventListener {
break;
}
case R.id.remove_bookmark: {
GeckoAppShell.getHandler().post(new Runnable() {
public void run() {
ContentResolver resolver = Tabs.getInstance().getContentResolver();
BrowserDB.removeBookmark(resolver, url);
Toast.makeText(this, R.string.bookmark_removed, Toast.LENGTH_SHORT).show();
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
public void run() {
Toast.makeText(this, R.string.bookmark_removed,
Toast.LENGTH_SHORT).show();
}
});
}
});
break;
}
case R.id.add_to_launcher: {