How can we override the home key in Android JB and above.I have searched a lot of threads but those doesn't work for Latest android versions.Also this is possible as I have checked in some apps available in Play Store such as "Active LockScreen".
Asked
Active
Viewed 87 times
-1
-
1not possible to override home key – Raghunandan Sep 27 '13 at 19:21
-
@Raghunandan ... yes it's definitely possible ...please check this app "Active LockScreen" on Play store – ddnith Sep 27 '13 at 19:23
-
1not possible without a workaround. implement a home screen – Raghunandan Sep 27 '13 at 19:23
-
@Raghunandan I have already checked the link for whicj you have duplicated my question.It doesn't work. – ddnith Sep 27 '13 at 19:32
-
@ddnith A quick question, do you just want to detect if user has pressed the`Home` key and do something on the key being pressed(and app goes to background)? Or you want to change its functionality completely? Or some other stuff. I understand that you want to override it. But what exactly you want to do with it? – Shobhit Puri Sep 27 '13 at 19:59
-
@ShobhitPuri I want to change the functionality.I want to keep my activity in front even if HOME key is pressed.Actually I want to implement mu own lock screen. – ddnith Sep 27 '13 at 20:06
2 Answers
1
you cannot override the home button for security reason. it is the only way a user can always leave an app

tyczj
- 71,600
- 54
- 194
- 296
-
-
-
-
-
@tyczj making an app Launcher is not an option.If I make my app Launcher it will ask to chose bw default launcher and my app each time user press the home key – ddnith Sep 27 '13 at 19:27
-
what you want to do is not an option really, there is a reason why it cant be done – tyczj Sep 27 '13 at 19:37
-
See e.g. http://stackoverflow.com/questions/10864300/create-a-lock-screen-of-my-own – Joseph Earl Sep 27 '13 at 23:13
0
As of now I have found the way by making my app Launcher and let the user chose if he/she want to disable the home key functionality while App is running.While App is not in foreground My App fires Intent DEFAULT_LAUNCHER_INTENT to display the DEFAULT Launcher. I'll post if find another work around without making the app Launcher.

ddnith
- 151
- 4
- 12