Chris Sherlock
Chris Sherlock

Reputation: 941

How to remove app from launcher (on a rooted device) programmatically

How can I remove an app from the launcher of an rooted device ?

Upvotes: 5

Views: 2575

Answers (4)

Ajay Vishwakarma
Ajay Vishwakarma

Reputation: 327

Actually from android 10+, it is quite difficult to hide the app launcher icon. I have used the code of @shridutt kothari, just mentioned in the above comments. When the disable code runs, it only make the app launcher icon disabled not hidden. But you cannot launch it, it open the app info setting page when click the launcher icon.

Another way - This is another way to do that, make a app and run it as device owner mode. Then we can able to hide/remove the app launcher icon.

Visit the link- https://www.sisik.eu/blog/android/dev-admin/uninstalling-and-disabling-apps

Upvotes: 0

Shridutt Kothari
Shridutt Kothari

Reputation: 7394

To hide app icon from launcher we can do it in following way:

    PackageManager p = getPackageManager();
    ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class);     
p.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

To un-hide app icon from launcher we can do it in following way:

PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class);
p.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);

Upvotes: 0

Mostafa zamani
Mostafa zamani

Reputation: 78

i find this may it helps

    Uri uri = Uri.parse("package:com.domain.app");
    Intent i = new Intent(Intent.ACTION_DELETE, uri);
    startActivity(i);

Upvotes: 2

Related Questions