• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Hide application from Android application list

Hello all,

Is there any way to hide an application icon from Android applications list ? The application should be downloaded from Market and opened some GUI for configuring my application. I don't want to see any icon of my application in applications list. User should not be able to run it.

By the way I know some way:
remove this line from manifest
<category android:name="android.intent.category.LAUNCHER" />

But it is not worked for me, because the GUI is not shown.

Thanks very much !
 
Thanks all for replay,
I found a way to hide application icon from application list
PackageManager pm = getApplicationContext().getPackageManager();
pm.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

But in time of application reinstalling occurs error "Activity class does not exist" and it is not possible to reinstall application without uninstalling it. .... what's the problem ?
 
Upvote 0
Dude just get launcher pro


Launcher Pro is an application. My application should be downloaded from Android Market and there is no guarantee that all users have Launcher Pro.
I want programmatically hide application icon from application list. The method with PackageManager works for me ... but there is a problem regarding reinstalling. It is important when you want to update the application from Market.:(
 
Upvote 0
Hello all,

Is there any way to hide an application icon from Android applications list ? The application should be downloaded from Market and opened some GUI for configuring my application. I don't want to see any icon of my application in applications list. User should not be able to run it.

By the way I know some way:
remove this line from manifest
<category android:name="android.intent.category.LAUNCHER" />

But it is not worked for me, because the GUI is not shown.

Thanks very much !

Hi,
Do you found any solution?
Please let me now.....

Thanks
 
Upvote 0
Sup guys, i suggest creating a group on your regular app drawer with all your apps minus the ones you want to hide. I named my new group 'All' and i dought anyone will guess to switch to the group i have my private apps on (being the real "all apps"). Even if they are looking for something. The best part is once you select the group to show your everyday usage, it stays on that group until you change it; even upon restarting the phone!
 
Upvote 0
I understand that you managed to find an answer to this, however I just wanted to let you know that there is an easier way. In your application's manifest, if you remove the
<category android:name="android.intent.category.LAUNCHER" /> element from all of your activity elements, then it will not show up. Inversely, if you add the tag to any activity, that activity (whether it is the main one or not), will be given a place in the applications list.
 
  • Like
Reactions: calcng
Upvote 0
I have found a way for this to work when you reinstall the app.

Add a broadcast receiver with intent filter action android.intent.action.PACKAGE_ADDED. In the onReceived method you must activate your disabled component :

ComponentName componentToEnable = new ComponentName(context, Your_disabled_class.class);
PackageManager pm = context.getPackageManager();
pm.setComponentEnabledSetting(componentToEnable, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);

Complete xml for receiver:

<receiver android:name="PackageChangeReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<action android:name="android.intent.action.PACKAGE_REPLACED"/>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>

<data android:scheme="package"/>
</intent-filter>
</receiver>
 
Upvote 0
Hey Ciucaandrei,
Actually i can not understand the ComponentName class constructor argument. If i want to hide specific application like "WhatsApp" then i need the package name and class name.

for 1st Parameter is "String" package name : "packageInfo.packageName" - it shows me "com.whatsapp"
and the 2nd parameter "String" is class name : "packageInfo.className" it shows me "null".

And when i create "BroadCastReceiver" it shows me warning :

11-15 16:40:55.318: W/System.err(32535): java.lang.SecurityException: Permission Denial: attempt to change component state from pid=32535, uid=10127, package uid=10100
11-15 16:40:55.318: W/System.err(32535): at android.os.Parcel.readException(Parcel.java:1431)
11-15 16:40:55.318: W/System.err(32535): at android.os.Parcel.readException(Parcel.java:1385)
11-15 16:40:55.318: W/System.err(32535): at android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:2638)
11-15 16:40:55.318: W/System.err(32535): at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1262)
11-15 16:40:55.318: W/System.err(32535): at com.example.lockscreenpattern.PackageChangeReceiver.onReceive(PackageChangeReceiver.java:21)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2424)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.access$1500(ActivityThread.java:141)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332)
11-15 16:40:55.318: W/System.err(32535): at android.os.Handler.dispatchMessage(Handler.java:99)
11-15 16:40:55.318: W/System.err(32535): at android.os.Looper.loop(Looper.java:137)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.main(ActivityThread.java:5103)
11-15 16:40:55.318: W/System.err(32535): at java.lang.reflect.Method.invokeNative(Native Method)
11-15 16:40:55.318: W/System.err(32535): at java.lang.reflect.Method.invoke(Method.java:525)
11-15 16:40:55.318: W/System.err(32535): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-15 16:40:55.318: W/System.err(32535): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-15 16:40:55.318: W/System.err(32535): at dalvik.system.NativeStart.main(Native Method)

Can you please tell me what's wrong in my code?

Thanks in Advance.
 
Upvote 0
Hey Ciucaandrei,
Actually i can not understand the ComponentName class constructor argument. If i want to hide specific application like "WhatsApp" then i need the package name and class name.

for 1st Parameter is "String" package name : "packageInfo.packageName" - it shows me "com.whatsapp"
and the 2nd parameter "String" is class name : "packageInfo.className" it shows me "null".

And when i create "BroadCastReceiver" it shows me warning :

11-15 16:40:55.318: W/System.err(32535): java.lang.SecurityException: Permission Denial: attempt to change component state from pid=32535, uid=10127, package uid=10100
11-15 16:40:55.318: W/System.err(32535): at android.os.Parcel.readException(Parcel.java:1431)
11-15 16:40:55.318: W/System.err(32535): at android.os.Parcel.readException(Parcel.java:1385)
11-15 16:40:55.318: W/System.err(32535): at android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:2638)
11-15 16:40:55.318: W/System.err(32535): at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1262)
11-15 16:40:55.318: W/System.err(32535): at com.example.lockscreenpattern.PackageChangeReceiver.onReceive(PackageChangeReceiver.java:21)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2424)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.access$1500(ActivityThread.java:141)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332)
11-15 16:40:55.318: W/System.err(32535): at android.os.Handler.dispatchMessage(Handler.java:99)
11-15 16:40:55.318: W/System.err(32535): at android.os.Looper.loop(Looper.java:137)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.main(ActivityThread.java:5103)
11-15 16:40:55.318: W/System.err(32535): at java.lang.reflect.Method.invokeNative(Native Method)
11-15 16:40:55.318: W/System.err(32535): at java.lang.reflect.Method.invoke(Method.java:525)
11-15 16:40:55.318: W/System.err(32535): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-15 16:40:55.318: W/System.err(32535): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-15 16:40:55.318: W/System.err(32535): at dalvik.system.NativeStart.main(Native Method)

Can you please tell me what's wrong in my code?

Thanks in Advance.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones