I set one of the program as default launcher program and default setting program so I cannot change the default programs now, can I change the default programs from
android-sdk\android-sdk\platform-tools\adb.exe or remote shell.
How can I do that?
And can I remove the defaults of program in Java code?
you can remove (Uninstall) the default program you set using ADB by doing this :
adb uninstall app.package ..... //for example (com.example.homeapp)
If you don’t want to remove the app .. here is a quick hack to do it:
- adb shell
- am start -a android.intent.action.MAIN
That way you will have a picker with all apps on your devices that listens to Main Action
- Choose any home screen app you want . then go to settings and set it as default.
For system apps you can’t uninstall, use pm disable as in
adb shell pm disable com.android.launcher
adb shell cmd package set-home-activity “package/activity”
The key is adb. Once you know the package name of the app you wish to clear data for, try:
adb shell pm clear package.name.of.app
It’ll clear all data for the app, but I don’t know of a way to only clear the defaults.