Hide Android program icons

Source: Internet
Author: User

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

  1. <Span style = "white-space: pre"> </span> <intent-filter>
  2. <Span style = "white-space: pre"> </span> <action Android: Name = "android. Intent. Action. Main"/>
  3. <Category Android: Name = "android. Intent. Category. launcher"/>
  4. </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

  1. <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 );

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.