mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 769894 - Part 1: Create PromptService's AlertDialog on the UI thread. r=mfinkle
This commit is contained in:
parent
111e917ff3
commit
9015e11bc7
@ -190,7 +190,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
||||
}
|
||||
});
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(GeckoApp.mAppContext);
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(GeckoApp.mAppContext);
|
||||
if (!aTitle.equals("")) {
|
||||
builder.setTitle(aTitle);
|
||||
}
|
||||
@ -256,9 +256,14 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
||||
builder.setNegativeButton(aButtons[2].label, this);
|
||||
}
|
||||
|
||||
mDialog = builder.create();
|
||||
mDialog.setOnCancelListener(this);
|
||||
mDialog.show();
|
||||
// The AlertDialog must be created on the UI thread, not the GeckoBackgroundThread.
|
||||
GeckoAppShell.getMainHandler().post(new Runnable() {
|
||||
public void run() {
|
||||
mDialog = builder.create();
|
||||
mDialog.setOnCancelListener(PromptService.this);
|
||||
mDialog.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onClick(DialogInterface aDialog, int aWhich) {
|
||||
|
Loading…
Reference in New Issue
Block a user