Android-install app (APP) does not display icon

Source: Internet
Author: User

App does not display icons

This address: www.2cto.com

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

                 




Several solutions for deleting app icons:

1, androidmanifest.xml file in the entrance activity of the intent-filter removed

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 app icon has a problem, hidden will not be able to display the app icon, in the settings of all applications are not found;
The value of the parameter to these two values is not a problem, it is recommended to use these two values.

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

But after you've tried each method, you find that it works but there are other problems:

1, if removed, it means that the app does not start the portal,
This does not show the effect of the icon, but then our application can not run.

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.
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, I do not say, I think it is the practice of cornered.

The best solution:
The next thing I want to say is that this method can hide the icon, or it can start running normally.
The element is set in Intent-filter in the manifest entry activity.
For 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.