I accidentally discovered this because my application was installed and tested. According to the response of Eclipse, my application was installed but not running. No icon is found, but this program can be found in program management. Later, I searched on Google and found that I already had it, but I wrote it down to make it easier for me to remember.
[Java]View
Plaincopy
- <Span style = "white-space: pre"> </span> <intent-filter>
- <Span style = "white-space: pre"> </span> <action Android: Name = "android. Intent. Action. Main"/>
- <Category Android: Name = "android. Intent. Category. launcher"/>
- </Intent-filter>
This code originally represents the program portal of our Android Application.
But I didn't understand the meaning of the second sentence.
[Java]View
Plaincopy
- <Category Android: Name = "android. Intent. Category. launcher"/>
In fact, it is not completely understood.
Personally, this means that our application or main activity will be displayed on the main interface of our Android system.
In this way, without writing, we will not have our icons on the interface, and we will not be able to start it.
Display
Packagemanager P = getpackagemanager ();
P. setcomponentenabledsetting (getcomponentname (),
Packagemanager. component_enabled_state_enabled,
Packagemanager. dont_kill_app );
Hide
Packagemanager P = getpackagemanager ();
P. setcomponentenabledsetting (getcomponentname (),
Packagemanager. component_enabled_state_disabled,
Packagemanager. dont_kill_app ); |