1. Welcome to the newer, better version of Android Forums! Be sure to see the announcement and enjoy checking it out!

    Some of you have been having login issues. - Please try now. Sorry for the trouble!
  2. All attachments uploaded on the first day of this new look need to be re-uploaded, or will appear broken. All prior to that, and all going forward, should work fine. We apologize for the inconvenience!

Hide application from Android application list


  1. artakus

    artakus New Member

    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 !

    Advertisement
  2. pancake_old

    pancake_old Member

    LauncherPro will allow you to hide icons in the app drawer. It's also a great launcher.
  3. Shane Bond

    Shane Bond Member

    User should not be able to run it.
  4. artakus

    artakus New Member

    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 ?
  5. JevyJav

    JevyJav Well-Known Member

    Dude just get launcher pro
  6. artakus

    artakus New Member


    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.:(
  7. saberhack

    saberhack Active Member

    make an app for that
  8. khichis

    khichis New Member

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

    Thanks
  9. bluenova

    bluenova OK Computer VIP Member

    You're getting the wrong kind of answers because the thread was in the wrong place ;). I've moved it over to the app development section where you will get better advice.
  10. denevell

    denevell New Member

    I'd also read about the editing of the XML file; removal of the android.intent.category.launcher. I'll have a look later. I'm intrigued as to why you want to do this. Why do you?
  11. miXer

    miXer Well-Known Member

    If you want to be able to configure the application, i think you need to have an icon. How should the user be able to configure the application if you don't have an icon?
  12. regenc

    regenc New Member

    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!
  13. jonbonazza

    jonbonazza Well-Known Member

    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.
    calcng likes this.
  14. ciucaandrei

    ciucaandrei New Member

    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>
  15. jonbonazza

    jonbonazza Well-Known Member

    This is the correct way of doing things.
  16. Lawrance

    Lawrance New Member

    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.
  17. Lawrance

    Lawrance New Member

    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.

Share This Page