From 4711fa696ab8ef311fcd21c6cec816158fa9c799 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Sat, 25 Apr 2015 22:22:24 -0400 Subject: [PATCH] Workaround for a bug in LG devices --- src/acr/browser/lightning/BrowserActivity.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/acr/browser/lightning/BrowserActivity.java b/src/acr/browser/lightning/BrowserActivity.java index 101b6cb..81259ef 100644 --- a/src/acr/browser/lightning/BrowserActivity.java +++ b/src/acr/browser/lightning/BrowserActivity.java @@ -716,10 +716,25 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll if (mSearch.hasFocus()) { searchTheWeb(mSearch.getText().toString()); } + } else if ((keyCode == KeyEvent.KEYCODE_MENU) && (Build.VERSION.SDK_INT <= 16) + && (Build.MANUFACTURER.compareTo("LGE") == 0)) { + // Workaround for stupid LG devices that crash + return true; } return super.onKeyDown(keyCode, event); } + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + if ((keyCode == KeyEvent.KEYCODE_MENU) && (Build.VERSION.SDK_INT <= 16) + && (Build.MANUFACTURER.compareTo("LGE") == 0)) { + // Workaround for stupid LG devices that crash + openOptionsMenu(); + return true; + } + return super.onKeyUp(keyCode, event); + } + @Override public boolean onCreateOptionsMenu(Menu menu) { return super.onCreateOptionsMenu(menu);