In my app I have a button that if the user clicks than a text box appears on the screen
(I use the setVisibility from GONE to VISIBILE).
the problem I have is when the user presses the BACK button on the device : it closes my app.
Is there any way that when the user presses the BACK button than my code will be called (so I can set the visibility to GONE) ?
The following works since API level 1:
Starting from API level 5 (android 2.0) you can also use:
See this android developer blog message for a complete overview.