0

Before you say that it is not posible look at Touch Lock App. This app efficiently disables all buttons.

So far I have successfully managed to disable all buttons except recent apps button. I have disabled it by listening on window out of focus change but this is not efficient enough.

@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    if(!hasFocus) {
        Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        sendBroadcast(closeDialog);
    }
}

The thing i noticed in the Touch Lock App is that when I click back or recent app button while the lock is on the buttons don't highlight at all.

Unlike Touch Lock App, in other apps for disabling buttons and in my app, the buttons back and recent apps highlight on press. I disabled back button by overriding onBackPressed() but on click it still highlights.

Does anyone has a clue how to disable the recent apps button or what is the key to highlighting recent apps and back button?

Buttons when being locked by Touch Lock App enter image description here

Buttons when being locked by other apps or mine enter image description here

Obviousely there must be a way to override the click since the buttons doesn't highlight. Also, the vibration from button press triggers even in the Touch Lock App.

Can someone explain what exactly(deep in android system) happens when user clicks on the button, what functions are triggered. Meaning, what function triggers vibration from the button click and what function triggers the button highlight? Can you at least point me in some direction?

user3632055
  • 236
  • 5
  • 13
  • Here: http://stackoverflow.com/questions/17769367/android-intercept-recent-apps-button – user2520215 Apr 04 '16 at 22:04
  • Here, another. http://stackoverflow.com/questions/30979005/block-disable-recent-apps-button – user2520215 Apr 04 '16 at 22:05
  • All of these answers are based on closing all System dialogs when windows loses focus, as i mentioned in the question. This way the recent apps button is disabled, but the screen flashes and activity beneath my app is replaced with a recent apps so this solution is not efficient enough for me – user3632055 Apr 05 '16 at 04:52

0 Answers0