Question


The application that I'm developing must look like a launcher. I opened this topic because of I couldn't find the correct answer in whole topics that I looked at in Stack Overflow.
I want the application to disable or control whole buttons to exit this application. I disabled home and back button on Android 2.3 but it doesn't work on Android 4.0 (except for back button).
To conclude, I couldn't and I want to disable only home button on Android 4.0
Can you give an advice except the other answers?

Was it helpful?

Solution

There is no way to intercept the home button on Android, unless you make your app the home screen. This is for security reasons, so that malicious apps cannot take over your device by overriding all the buttons that can exit. The home button is the one sure shot way to be able to leave any app.

In short, no it's not possible, and even if it were, it is a serious disruption in what a user expects out of an app's behavior. You will have to go with making your app into a launcher if you want to achieve this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top