I need to know how to keep the user (child in this case) from accidentally hitting the home button and others closing the app. I want a parent to be able to hand the baby the phone and as she/he taps it will make sounds. That's all. My little one is my beta tester and she keeps closing it unintentionally then getting mad. I'm using android studio with ics+ support.
Asked
Active
Viewed 120 times
1 Answers
0
Although it is possible by overriding the onPause()
method, or relaunching the app when closed, both shown here.
I would recommend checking if the phone is running 5.0 or higher. If it is, then show how to use screen pinning, which requires the overview and back buttons to be held together for 5 seconds - something which a small child is unlikely to do.

Sampath Eaty
- 19
- 5
-
Ill look into that thank you. I have no problem with bumping up the support I offer. Screen pinning is users choice right? I could call a dialog to ask if they would like to activate that before using app then I assume? – Robert Dimaggio Sep 06 '17 at 00:40
-
Yes, screen pinning is something the user must do. I would recommend launching the settings page with the applicable option, and demonstrating how to activate screen pinning in the app itself. EDIT: It seems that this is not the case: Refer to https://stackoverflow.com/questions/28204829/screen-pinning-3rd-party-apps-programmatically https://datatheorem.github.io/android/2014/12/29/android-screen-pinning/ https://github.com/darryncampbell/LockTaskMode-Exerciser – Sampath Eaty Sep 06 '17 at 00:56