CB-1409: Clicking the menu button crashes Jellybean

This commit is contained in:
Simon MacDonald 2012-09-11 09:04:42 -04:00
parent a29340523f
commit a42f095cef

View File

@ -1001,10 +1001,10 @@ public class DroidGap extends Activity implements CordovaInterface {
public boolean onKeyUp(int keyCode, KeyEvent event)
{
//Determine if the focus is on the current view or not
if(appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE &&
keyCode == KeyEvent.KEYCODE_BACK)
{
return appView.onKeyUp(keyCode, event);
if (appView.getHitTestResult() != null &&
appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE &&
keyCode == KeyEvent.KEYCODE_BACK) {
return appView.onKeyUp(keyCode, event);
}
else
return super.onKeyUp(keyCode, event);