Clear default application settings

I use

category android:name="android.intent.category.HOME"
category android:name="android.intent.category.DEFAULT"

to override the behavior of the HOME button and point it to my application. On this particular tablet, I want this user application to start, and the average user cannot exit it (i.e. the tablet on the museum exhibit )

I have a hidden sequence to cause the application to close super.onDestroy (); this.finish (); but it just opens because I installed it as the default launch application. I know how to manually go to "Settings"> "Applications"> "Run default"> "Clear default" to reset this option, but is there any way that I can pragmatically clear the default settings in my application? If you have any ideas, let me know.

+5
source share
2 answers

I think clearPackagePreferredActivities()in PackageManagerwill do it for you.

+9
source

usb, , , .

adb shell rm/system/app/Launcher2.apk adb shell rm/system/app/Launcher2.odex

0

All Articles