开发者

Alter system brightness within a service

Although I am able to set the system brightness within an Activity successfully, it would seem that services don't fair too well. The brightness setting IS being set (I read it back and printed it to Logcat), but the brightness itself is not changing. My issue is very similar to this one:

Control scree开发者_StackOverflow中文版n brightness in android using " Background Service"

However, I'm not happy with the crude nature of the solution offered in that link. Is there a better way?

Thanks.


Got a solution! GeekYouUp's method here works: Update Display Brightness on Android after changing it programmatically

You need to make sure you finish() the activity with a small delay, that was my main issue. Sure it's not 'clean' to have a transparent activity pop up, but what can you do? I'm quite sure that there's no other way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜