Android-install app (APP) does not display icon

Source: Internet
Author: User

Install Apps (APP) does not display icons


This address: Http://blog.csdn.net/caroline_wendy


In the Androidmanifest registration of the activated activity, add the implicitly-initiated data:

        <!--Start Screen--        <activity                android:name= "me.wcl.Activities.WelcomeActivity"                android: Configchanges= "Keyboardhidden"                android:label= "@string/app_name"                android:theme= "@style/ Noactionbaractivity "                android:screenorientation=" Portrait ">            <intent-filter>                <action Android:name= "Android.intent.action.MAIN"/>                <data android:host= "authactivity" Android:scheme= " Com.wcl.www "/>                <category android:name=" Android.intent.category.LAUNCHER "/>            </ Intent-filter>        </activity>


Reference: http://blog.csdn.net/ydt_lwj/article/details/9419239/


Several solutions for deleting app icons:

1, androidmanifest.xml file in the entrance activity of the intent-filter removed
<category android:name= "Android.intent.category.LAUNCHER"/>
or change launcher to default


2, add the following code in the program
Show Picture:
Packagemanager p = Getpackagemanager ();p. setcomponentenabledsetting (Getcomponentname (), Packagemanager.component_ Enabled_state_enabled, Packagemanager.dont_kill_app);
Hide icon:
Packagemanager p = Getpackagemanager ();p. setcomponentenabledsetting (Getcomponentname (), Packagemanager.component_ Enabled_state_disabled, Packagemanager.dont_kill_app);
packagemanager.component_enabled_state_enabled//Show app icon
packagemanager.component_enabled_state_disabled//Hide app icon
I use these two values to show and hide the application icon has a problem, hidden will not be able to display the app icon, in the settings of all applications can not be found;
It is not a problem to have the value of the parameter as these two values, it is recommended to use both values.

3, remove android:icon= "@drawable/ic_launcher" in the resources Ah, and so on ...

But after you've tried every method, you find that it works, but it has other problems:

1, if remove <category android:name= "Android.intent.category.LAUNCHER"/&gt, it means that the app does not start the portal,
This really solves the effect of not showing the icon, but in that case our app won't work either.

2. Let's take a look at the instructions on Android Developer:
public static final int component_enabled_state_disabled
Flag for setapplicationenabledsetting (String, int, int) and setcomponentenabledsetting (componentname, int, int.): this Component or application have been explicitly disabled, regardless of what it have specified in its manifest.
This means that even if you declare this component or application in manifest, they are not available when you set it to component_enabled_state_disabled. That is, if you set this up in Mainactivity, the app icon won't show and the app won't run.

3, do not say, I think is cornered practice.

The best solution:
Next I want to say that this method can hide the icon, the same can also be started normally run.
In the manifest entry activity inside Intent-filter set <data></data> elements.
Like what:
<data android:host= "authactivity" android:scheme= "Com.android.example"/>
Note that Android:scheme is case-sensitive and must start with a lowercase letter
That is, this mainactivity can respond to specific Intent that are URI com.android.example://authactivity
But why does the app not show icons when you join this?
Because we declare the app's entry activity to be activated by the intent that receives the hermit, it will naturally not show the icon.
If you need to display an icon and must respond to the above URI, then we can add a intent-filter tag to the activity and move the data element to the new label.
This allows the application to display both an icon and a specific URI.




Android-install app (APP) does not display icon

Related Article

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.