I have been searching through Android docs and stackoverflow and most of the answers I am reading say that you cannot disable or override the Android home button.
Tried - does not work
Says not possible
The problem is there are known apps that are doing this:
Kids Care
Kids Place
This is what I want:
A parent loads the app then gives device to a child. The child can only see the approved apps that are on the device (I know how to do this part). If they load an approved app from the main launcher screen on my app - if they press the home button, it takes them back to my app and not back to the device home screen. If a user presses the home button from my app - nothing should happen. Same goes for the back button.
I am looking for the proper solution in duplicating functionality of Kids Care app in overriding home button. How do I do it?
If anyone is still interested, you could try putting this in your main activity in AndroidManifest.xml
<activity
...
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
....
</intent-filter>
</activity>
What you need to do is create your own launcher which either A) Starts another launcher or B) starts your activity. The launcher just has to be smart enough to know which to launch. So if you're in your app and you click "home" it will get into the launcher code and see that your app is running and decide to start your activity. However it it decides your app isn't running then it should start another launcher. If you remove the activity animations then it will appear seamless.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With