My question is on its own. I searched a lot, but could not find a way to handle the recent activity button. I want to ignore the clicks of the button on the "Recent Action" button on the toolbar from the status bar on the Android 3.0 tablet.
Currently, I have tried so far:
public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK) { return true; }
can you tell me what to write to handle the last activity button?
Thank you in advance. :)
EDIT: This is what I tried now. KEYCODE_APP_SWITCH does not work.
public boolean onKeyDown(int keyCode, KeyEvent event) { Log.e("INSIDE", "LOCKDEMO"); if (keyCode == KeyEvent.KEYCODE_BACK) { Log.e("KEY EVENT", "BACK"); return true; } if (keyCode == KeyEvent.KEYCODE_HOME) { Log.e("KEY EVENT", "HOME"); return true; } if(keyCode == KeyEvent.FLAG_FROM_SYSTEM) { Log.e("KEY EVENT", "SYSTEM"); return true; } if(keyCode == KeyEvent.FLAG_KEEP_TOUCH_MODE) { Log.e("KEY EVENT", "TOUCH MODE"); return true; } if(keyCode == KeyEvent.FLAG_SOFT_KEYBOARD) { Log.e("KEY EVENT", "SoFT KEYBOARD"); return true; } if(keyCode == KeyEvent.FLAG_VIRTUAL_HARD_KEY) { Log.e("KEY EVENT", "HARDWARE KEY"); return true; } if(keyCode == KeyEvent.KEYCODE_APP_SWITCH) { Log.e("KEY EVENT", "APP SWITCH"); return true; } Log.e("KEY EVENT", "NOT HANDLED"); return super.onKeyDown(keyCode, event); }
When I click on RecentAppBtn, it doesn't even print the last log statement, i.e. event is not processed.
android android-3.0-honeycomb statusbar
Shrikant Aug 20 2018-12-12T00: 00Z
source share