android 调节屏幕亮度
<span style="font-size:18px;"><strong>public void setBrightness(int level) { ContentResolver cr = getContentResolver(); Settings.System.putInt(cr, "screen_brightness", level); Window window = getWindow(); LayoutParams attributes = window.getAttributes(); float flevel = level; attributes.screenBrightness = flevel / 255; getWindow().setAttributes(attributes); } </strong></span>
静以修身,俭以养德。
posted on 2016-09-05 13:30 miaozhenzhong 阅读(186) 评论(0) 编辑 收藏 举报