650) this.width=650; "Src=" https://mmbiz.qlogo.cn/mmbiz/ Iahl5mqlicpyph1931fibvxnc3s2etiacdtdnodprvndnpf6ibvovy1btl9gefgheamtnmriovgwgm4lk8h6i1ps6eq/0?wx_fmt=jpeg "alt= "0?wx_fmt=jpeg"/>
Content Introduction
"Android" How to adjust the screen brightness, turn off the screen
"Android" How to adjust the screen brightness, turn off the screen
At work, record it.
Method 1:
PowerManager manager = (PowerManager) getsystemservice (Context.power_service); Powermanager.wakelock wl = Manager.newwakelock (Powermanager.partial_wake_lock, "Your Tag"); Wl.acquire (); Wl.release ( );
Remember to apply for permission in Androidmanifest.xml:
<uses-permission android:name= "Android.permission.WAKE_LOCK"/>
Method 2:
Windowmanager.layoutparams params = GetWindow (). GetAttributes ();p arams.flags |= layoutparams.flag_keep_screen_on; Params.screenbrightness = 0;getwindow (). SetAttributes (params);
This article is from the "Programmer Alliance Frogoscar" blog, so be sure to keep this source http://4526621.blog.51cto.com/4516621/1710423
"Android" How to adjust the screen brightness, turn off the screen