clear application defaults
Asked Answered
C

2

5

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.

Colima answered 20/7, 2011 at 12:1 Comment(0)
B
10

I think that clearPackagePreferredActivities() on PackageManager will do this for you.

Booma answered 20/7, 2011 at 14:31 Comment(1)
sure enough! perfect solution.Colima
F
0

Attach your phone with pc via usb then use command line to remove this default launcher permanently so you can open only your home screen or home launcher on each home press.

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

Forejudge answered 13/12, 2013 at 12:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.