[HTML] view Plaincopyprint?
public void Onwindowfocuschanged (Boolean hasfocus)
{
TODO auto-generated Method Stub
System.out.println ("Hasfocus--->>>" + hasfocus);
Super.onwindowfocuschanged (Hasfocus);
Try
{
-
object service = getSystemService ("StatusBar");
-
class<? > statusbarmanager
-
Class
Method Test = statusbarmanager. GetMethod ("collapse");
Test.invoke (service);
}
catch (Exception ex)
{
Ex.printstacktrace ();
}
}
Onwindowfocuschanged is a way to rewrite the activity inside, when executing this sentence means that the activity is loaded.
Remember to add permissions:
[HTML] view Plaincopyprint?
<uses-permission Android:name="Android.permission.EXPAND_STATUS_BAR" />
<!--<uses-permission android:name= "Android.permission.STATUS_BAR"/> --
4.1 Simulator test is useful, Huawei c8812 test is useful, but bug exists ...
Android Disable status bar dropdown