am 055a8585: Merge "Do not attempt to start action mode if there is no parent." into honeycomb-mr1

* commit '055a858562e04c903988d09973accc8aeeece02c':
  Do not attempt to start action mode if there is no parent.
This commit is contained in:
Leon Scroggins
2011-03-08 09:10:27 -08:00
committed by Android Git Automerger

View File

@@ -3017,7 +3017,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.
@@ -3027,7 +3028,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;
}