diff options
| author | Leon Scroggins <scroggo@google.com> | 2011-03-08 11:43:40 -0500 |
|---|---|---|
| committer | Leon Scroggins <scroggo@google.com> | 2011-03-08 11:43:40 -0500 |
| commit | 93553d7fb32cf888806bff8e179d724b53d43bbd (patch) | |
| tree | 2277cda059cfd09a0e6747e40333419cfc0c8e9b /core/java/android/webkit/WebView.java | |
| parent | 6478e4f0b0a6d34251ca0125eb6067f038e344aa (diff) | |
| download | frameworks_base-93553d7fb32cf888806bff8e179d724b53d43bbd.zip frameworks_base-93553d7fb32cf888806bff8e179d724b53d43bbd.tar.gz frameworks_base-93553d7fb32cf888806bff8e179d724b53d43bbd.tar.bz2 | |
Do not attempt to start action mode if there is no parent.
Bug:3514747
Change-Id: Id4c5c803bfb8bb2f5f81fa15599784e808e0d223
Diffstat (limited to 'core/java/android/webkit/WebView.java')
| -rw-r--r-- | core/java/android/webkit/WebView.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index f0a3a0f..32880aa 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3016,7 +3016,8 @@ public class WebView extends AbsoluteLayout } /** - * Start an ActionMode for finding text in this WebView. + * Start an ActionMode for finding text in this WebView. Only works if this + * WebView is attached to the view system. * @param text If non-null, will be the initial text to search for. * Otherwise, the last String searched for in this WebView will * be used to start. @@ -3026,7 +3027,7 @@ public class WebView extends AbsoluteLayout */ public boolean showFindDialog(String text, boolean showIme) { FindActionModeCallback callback = new FindActionModeCallback(mContext); - if (startActionMode(callback) == null) { + if (getParent() == null || startActionMode(callback) == null) { // Could not start the action mode, so end Find on page return false; } |
