I am developing an Android application. I want to hide any application icon (whatsapp,etc ....) in my android device and I want to start my application by pressing some numbers, for instance 456#. Is there a way to do this?
I know how to hide my app icon but i want to search how to hide other application icon.
Plz help me, thanx in advance.
So many question you have asked in your single query.Let me filter that.
I know how to my app icon hide but i want to search how to hide other application icon.
Basically you just have to pass Package name & Launcher activity of that application.
PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName("YOUR_PACKAGE_NAME", "YOUR_PACKAGE_NAME.LAUNCHER_ACTIVITY_NAME");
p.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
How to find the Launcher Activity of Installed App ?
In below code you will get launcher activity of all installed apps.
final PackageManager pm = getPackageManager();
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List < ResolveInfo > appList = pm.queryIntentActivities(mainIntent, 0);
Collections.sort(appList, new ResolveInfo.DisplayNameComparator(pm));
for (ResolveInfo temp: appList) {
Log.v("my logs", "package and activity name = " + temp.activityInfo.packageName + " " + temp.activityInfo.name);
}
I want to start my application by pressing some numbers, for instance 456#
So, Now you have almost done as you want try once and let me know.
The easiest way to hide or unhide any app is through cmd you have to only a command and buff.. its done
* for disable in Kitkat
String cmd = "pm disable" + packageName; Shell.SU.run(cmd);
for enable in Kitkat
String cmd = "pm enable " + packageName;
Shell.SU.run(cmd);
String cmd = "pm hide " + packageName;
Shell.SU.run(cmd);
for Unhide in lollipop
String cmd = "pm hide " + packageName;
Shell.SU.run(cmd);
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.