App icon Hidden

Source: Internet
Author: User

There are many articles written about the app hide icon. I wrote down my feelings.

The most seen situation is: Androidmanifest.xml file in the Intent-filter of the entry activity to remove <category android:name= " Android.intent.category.LAUNCHER "/> or LAUNCHER changed to default, so it can play the function of hiding the icon, but the program is not open, unable to run.

There is also a way to hide the icons in the following ways:

1Packagemanager Packagemanager =Getpackagemanager ();2ComponentName componentname =NewComponentName ( This, StartActivity.class);3 intres =packagemanager.getcomponentenabledsetting (componentname);4 if(res = =Packagemanager.component_enabled_state_default5|| res = =packagemanager.component_enabled_state_enabled) {6 //Hide App icon7 packagemanager.setcomponentenabledsetting (componentname, packagemanager.component_enabled_state_disabled, 8 Packagemanager.dont_kill_app);9}Else {Ten //Show app icon One packagemanager.setcomponentenabledsetting (componentname, Packagemanager.component_enabled_state_default,  A Packagemanager.dont_kill_app); -}

But I didn't work in this way. I use the following method:

<activityandroid:name= "tv.huan.xmpp.activity.MessageActivity" android:configchanges= "orientation| Keyboardhidden "android:screenorientation=" Portrait "><intent-filter><action android:name=" Android.intent.action.MAIN "/><data android:host=" authactivity "android:scheme=" Com.xtt.www "/>< Category android:name= "Android.intent.category.LAUNCHER"/></intent-filter></activity>

  

The main thing is to add this sentence: <data android:host= "authactivity" android:scheme= "com.xtt.www"/> In this way we declare the app's entry activity to be activated by the intent that receives the hermit, so that the icon will not be displayed naturally. However, it is important to note that scheme is case-sensitive, so that the entry activity we specify can respond to a specific Intent that is URI com.android.example://authactivity.

App icon Hidden

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.