I am using
category android:name="android.intent.category.HOME"
category android:name="android.intent.category.DEFAULT"
to override the HOME button behavior and point it to my application. On this particular tablet, i only want this custom application to run and for the average user not be able to exit out of it (ie. tablet at a museum exhibit)
I have a hidden sequence to trigger the close of the application super.onDestroy(); this.finish(); but it just opens back up because i have set it to be my default launcher application. I know how to manually go into Settings>Applications>Launch by Default>Clear Defaults to reset this setting, but is there a way that i can clear the defaults pragmatically in my app? If you have any ideas, please let me know.
Tap CLEAR DEFAULTS to clear out the default actions that you set. If the app is set as the default for some actions, you'll see You've chosen to launch this app by default and a CLEAR DEFAULTS option. If the app is not set as the default, you'll see No defaults set, and the CLEAR DEFAULTS option will be grayed out.
For starters, resetting will clear all the default apps. For instance, when you download a third-party gallery app, if you open a photo via file explorer, your phone will ask you to choose a default app. You'll be provided with two options – Once and Always.
A default app is the one you'd like your operating system to use to open certain files or links. Understandably, out of the box, Android defaults to Google applications. For instance, the default web browser for Android is Chrome.
I think that clearPackagePreferredActivities()
on PackageManager
will do this for you.
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