Browse Source

Workaround for a bug in LG devices

master
Anthony Restaino 10 years ago
parent
commit
4711fa696a
  1. 15
      src/acr/browser/lightning/BrowserActivity.java

15
src/acr/browser/lightning/BrowserActivity.java

@ -716,10 +716,25 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
if (mSearch.hasFocus()) { if (mSearch.hasFocus()) {
searchTheWeb(mSearch.getText().toString()); 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); 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 @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);

Loading…
Cancel
Save