简体   繁体   中英

Android hide app icon programatically

I have been trying to hide my app's icon from the app drawer and open it from dialler. The dialler part works perfertly, but i am having issues with hiding it. My problem is, if i hide my activity, it's get destroyed and i can no longer access it from my dialler. I have tried creating a duplicate activity as suggested here , but if i do that then my initial problem of hiding the icon is not solved.

Any ideas would be greatly appreciated.

I was doing it wrong. Just set the MainActivity as the launcher and set a duplicate activity in the dialler.

Please use this.

PackageManager pkg=this.getPackageManager(); pkg.setComponentEnabledSetting(new ComponentName(this,SplashActivity.class),PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM