diff options
| author | 2010-10-11 09:38:10 -0700 | |
|---|---|---|
| committer | 2010-10-11 09:38:10 -0700 | |
| commit | e69f1f1a748da99c82bcb56f6c7107a5618ba906 (patch) | |
| tree | 8c21c9549667afbc32ff9841e28c055f9259b1cc | |
| parent | df08c2f03e7cf7be7002d34efe8e4e8d24e406de (diff) | |
| parent | e3cfd35bf4d430e56456818bf8c84ef4c2c0dfde (diff) | |
resolved conflicts for merge of e3cfd35b to gingerbread-plus-aosp
Change-Id: I2f90572163e7cb98e4e2762998a2ac63cc267dea
| -rw-r--r-- | core/java/android/webkit/WebView.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index fbc1b6510763..af1116981872 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -313,6 +313,10 @@ public class WebView extends AbsoluteLayout // true means redraw the screen all-the-time. Only with AUTO_REDRAW_HACK private boolean mAutoRedraw; + // Reference to the AlertDialog displayed by InvokeListBox. + // It's used to dismiss the dialog in destroy if not done before. + private AlertDialog mListBoxDialog = null; + static final String LOGTAG = "webview"; private static class ExtendedZoomControls extends FrameLayout { @@ -1296,6 +1300,10 @@ public class WebView extends AbsoluteLayout */ public void destroy() { clearHelpers(); + if (mListBoxDialog != null) { + mListBoxDialog.dismiss(); + mListBoxDialog = null; + } if (mWebViewCore != null) { // Set the handlers to null before destroying WebViewCore so no // more messages will be posted. @@ -7509,7 +7517,7 @@ public class WebView extends AbsoluteLayout EventHub.SINGLE_LISTBOX_CHOICE, -2, 0); }}); } - final AlertDialog dialog = b.create(); + mListBoxDialog = b.create(); listView.setAdapter(adapter); listView.setFocusableInTouchMode(true); // There is a bug (1250103) where the checks in a ListView with @@ -7531,7 +7539,8 @@ public class WebView extends AbsoluteLayout int position, long id) { mWebViewCore.sendMessage( EventHub.SINGLE_LISTBOX_CHOICE, (int)id, 0); - dialog.dismiss(); + mListBoxDialog.dismiss(); + mListBoxDialog = null; } }); if (mSelection != -1) { @@ -7543,13 +7552,14 @@ public class WebView extends AbsoluteLayout adapter.registerDataSetObserver(observer); } } - dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + mListBoxDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { public void onCancel(DialogInterface dialog) { mWebViewCore.sendMessage( EventHub.SINGLE_LISTBOX_CHOICE, -2, 0); + mListBoxDialog = null; } }); - dialog.show(); + mListBoxDialog.show(); } } |