I have read a lot about how we cannot override or disable home button. And I too agree that its risky in many ways as some people might take wrong advantage of it. But unfortunately its a requirement in my app.
I was able to hide them in my device which runs on Android Kitkat using the Immersive
feature. Its true that when user swipes from the edge of the screen it makes the status and navigation bar visible. But I found out a way to disappear it again by calling Immersive
every second or so using CountDownTimer
. The result was satisfactory and got the job done.
But I do not have any solution for Android devices which does not run on Kitkat as the bars appear every time we interact with screen. Even though the bars hide but appearing every time the user touches the screen does not look good. So Immersive
feature is out of question since it does not run except for Kitkat.
I did try out another solution suggested in various SO posts -
Making my activity visible when the screen is locked. This helped me to get rid of the third button (button right side of Home button, not sure what it is called). And we could easily handle back button. But still home button is remaining. I need to somehow make this Home button disable or do nothing. Or atleast (worst case scenario) navigate to my app when ever I click on home button (Is it possible?)
What I am looking for is the user should only be able to leave the app from a button which I have provided in my app, there should'nt be any other way. Can someone suggest me a way to achieve this?
I am on a deadline here. Any help on this will be helpful to me greately. I am also open for other ways of achieving the above nonesense feature.
Thanks :)