I'm trying to replace the stock lock screen with my own app.
In my code, i want to disable the Home button.
I know how to do this in Android 2.3 and below,
but the same code doesn't work with Android 4.0+ (return to desktop when Home button pressed)
Recently I found out an app called MiHome which has its own lock screen and is able to disable the Home button.
Does anyone know how it achieves this???
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.
If you want to handle the HOME button, implement a home screen.