[英]How to put my phone in dim mode in Android?
I want to put my phone in dim mode using my application. 我想使用我的应用程序将手机置于暗淡模式。 It seems phone's home screen will be in deem mode.
似乎手机的主屏幕将处于deem模式。 If I going to use Power Manager class then it will drain battery.
如果我要使用电源管理器类,则它将耗尽电池电量。 How can I do this then?
那我该怎么做呢? Can any one give some sample code?
任何人都可以提供一些示例代码吗?
In my case I just update the Android Default Settings, 就我而言,我只是更新了Android默认设置,
android.provider.Settings.System.putInt(cr,android.provider.Settings.System.SCREEN_BRIGHTNESS, 1);
Note: here 1 is value for dim (low) (values 0 t0 250) , and cr is ContentResolver's object 注意:这里1是dim(low)的值(值0 t0 250),而cr是ContentResolver的对象
For this you have to mentioned permission in manifest file, 为此,您必须在清单文件中提及权限,
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.