Search code examples
androidandroid-homebutton

How to know when the home button is pressed?


In my app I want to make a change that at any point of time i.e at any activity I press Home button it shows a dialog box asking for "You want to logout?" .

I have read that overriding of Home button is not possible. Is that true? Any ideas?


Solution

  • hi you can't handle Home button in android as per to my knowledge. but yes you can do like this follow this Catch keypress with android