Android的屏幕亮度,它不会崩溃 [英] Android screen brightness that doesn't crash

查看:297
本文介绍了Android的屏幕亮度,它不会崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个提升屏幕亮度的活动

I have an activity that boosts screen brightness

/ *把屏幕亮度高达* /
this.getWindow()的getAttributes()screenBrightness = 1;

我发现这个内置android系统功能崩溃的一些手机。

I found out this built in android function crashes some phones.

有提高屏幕亮度更普遍的方式?

Is there a more universal way to boost screen brightness?

推荐答案

要设置属性的正确方法是用 setAttributes()

The correct way to set attributes is with setAttributes():

WindowManager.LayoutParams lp = this.getWindow().getAttributes();
lp.screenBrightness = 1;
this.getWindow().setAttributes(lp);

这篇关于Android的屏幕亮度,它不会崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆