The android4.03 Home button is blocked by an alternative method.

Source: Internet
Author: User
 
   
    
     
     
     
    
   
Package COM. xxx. android. system; import Java. util. list; import android. app. activity; import android. content. intent; import android. content. PM. packagemanager; import android. content. PM. resolveinfo; import android. OS. bundle; import android. widget. toast;/*** with the support of the manufacturer, give up this alternative method of shielding the Home Key. ** @ Author asiontang * @ date March 13, 2013 14:48:44 */@ deprecatedpublic class emptyhome extends activity {public static Boolean isexited = true; @ override protected void oncreate (final bundle savedinstancestate) {super. oncreate (savedinstancestate); If (isexited) {final packagemanager = This. getpackagemanager (); Final intent = new intent (intent. action_main); intent. addcategory (in Tent. category_home); final list <resolveinfo> List = packagemanager. queryintentactivities (intent, packagemanager. match_default_only); For (INT I = 0; I <list. size (); I ++) {final string name = List. get (I ). activityinfo. packagename; If (! "Emptyhome ". equals (name) {intent. setpackage (name); break;} This. startactivity (intent); toast. maketext (this, "home", toast. length_short ). show ();} This. finish ();}}

 

 

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.