Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Like Tree1Likes
  • 1 Post By jonbonazza

test: Reply
 
LinkBack Thread Tools
Old November 1st, 2010, 03:44 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2010
Location: Yerevan, Armenia
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 !

Advertisements
artakus is offline  
Reply With Quote
sponsored links
Old November 1st, 2010, 06:34 AM   #2 (permalink)
New Member
 
Join Date: Oct 2010
Posts: 9
 
Device(s):
Carrier: Not Provided

Thanks: 3
Thanked 0 Times in 0 Posts
Default

LauncherPro will allow you to hide icons in the app drawer. It's also a great launcher.
pancake_old is offline  
Reply With Quote
Old November 1st, 2010, 06:57 AM   #3 (permalink)
New Member
 
Join Date: Nov 2010
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

User should not be able to run it.
Shane Bond is offline  
Reply With Quote
Old November 11th, 2010, 05:06 AM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2010
Location: Yerevan, Armenia
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 ?
artakus is offline  
Reply With Quote
Old November 11th, 2010, 05:42 AM   #5 (permalink)
Member
 
JevyJav's Avatar
 
Join Date: Mar 2010
Location: VT
Posts: 132
 
Device(s): unlocked gsm galaxy nexus
Carrier: Not Provided

Thanks: 23
Thanked 42 Times in 29 Posts
Jevyjav
Default

Dude just get launcher pro
JevyJav is offline  
Reply With Quote
Old November 12th, 2010, 01:10 AM   #6 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2010
Location: Yerevan, Armenia
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by JevyJav View Post
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.
artakus is offline  
Reply With Quote
Old November 12th, 2010, 03:48 AM   #7 (permalink)
Junior Member
 
saberhack's Avatar
 
Join Date: Oct 2010
Posts: 25
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 0 Times in 0 Posts
Default

make an app for that
saberhack is offline  
Reply With Quote
Old March 10th, 2011, 01:08 AM   #8 (permalink)
New Member
 
Join Date: Sep 2010
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Found solution?

Quote:
Originally Posted by artakus View Post
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
khichis is offline  
Reply With Quote
Old March 10th, 2011, 04:32 AM   #9 (permalink)
OK Computer
 
bluenova's Avatar
 
Join Date: Jan 2010
Location: W Midlands, UK
Posts: 1,618
 
Device(s): Samsung Galaxy Note - 4.2.2
Carrier: Everything Everywhere

Thanks: 189
Thanked 251 Times in 181 Posts
Default

Quote:
Originally Posted by artakus View Post
Launcher Pro is an application. My application should be downloaded from Android Market and there is no guarantee that all users have Launcher Pro.
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.
bluenova is offline  
Reply With Quote
Old March 10th, 2011, 12:49 PM   #10 (permalink)
New Member
 
Join Date: Mar 2011
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
denevell is offline  
Reply With Quote
sponsored links
Old March 10th, 2011, 01:47 PM   #11 (permalink)
Member
 
Join Date: Aug 2010
Location: Norway
Posts: 313
 
Device(s): Samsung Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 53 Times in 51 Posts
Default

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?
miXer is offline  
Reply With Quote
Old April 25th, 2012, 02:58 AM   #12 (permalink)
New Member
 
Join Date: Apr 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!
regenc is offline  
Reply With Quote
Old April 25th, 2012, 08:40 AM   #13 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

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.
nosenseofhumor likes this.
jonbonazza is offline  
Reply With Quote
The Following User Says Thank You to jonbonazza For This Useful Post:
calcng (November 21st, 2013)
Old August 20th, 2012, 07:42 AM   #14 (permalink)
New Member
 
Join Date: Aug 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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_REPLAC ED"/>
<action android:name="android.intent.action.PACKAGE_REMOVE D"/>

<data android:scheme="package"/>
</intent-filter>
</receiver>
ciucaandrei is offline  
Reply With Quote
Old August 21st, 2012, 10:57 AM   #15 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Quote:
Originally Posted by denevell View Post
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?
This is the correct way of doing things.
jonbonazza is offline  
Reply With Quote
Old November 15th, 2013, 05:00 AM   #16 (permalink)
New Member
 
Join Date: Nov 2013
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.setC omponentEnabledSetting(IPackageManager.java:2638)
11-15 16:40:55.318: W/System.err(32535): at android.app.ApplicationPackageManager.setComponent EnabledSetting(ApplicationPackageManager.java:1262 )
11-15 16:40:55.318: W/System.err(32535): at com.example.lockscreenpattern.PackageChangeReceive r.onReceive(PackageChangeReceiver.java:21)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.handleReceiver(Activity Thread.java:2424)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.access$1500(ActivityThr ead.java:141)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread$H.handleMessage(Activit yThread.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.jav a: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$MethodAndArgsCa ller.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.
Lawrance is offline  
Last edited by Lawrance; November 15th, 2013 at 05:32 AM.
Reply With Quote
Old November 15th, 2013, 05:31 AM   #17 (permalink)
New Member
 
Join Date: Nov 2013
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.setC omponentEnabledSetting(IPackageManager.java:2638)
11-15 16:40:55.318: W/System.err(32535): at android.app.ApplicationPackageManager.setComponent EnabledSetting(ApplicationPackageManager.java:1262 )
11-15 16:40:55.318: W/System.err(32535): at com.example.lockscreenpattern.PackageChangeReceive r.onReceive(PackageChangeReceiver.java:21)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.handleReceiver(Activity Thread.java:2424)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread.access$1500(ActivityThr ead.java:141)
11-15 16:40:55.318: W/System.err(32535): at android.app.ActivityThread$H.handleMessage(Activit yThread.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.jav a: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$MethodAndArgsCa ller.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.
Lawrance is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:49 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.