2
A
回答
4
You can use this API。这将改变你的窗口而不是整个系统的屏幕亮度。
// Make the screen full bright for this activity.
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 1.0f;
getWindow().setAttributes(lp);
2
这code snippet应该可以帮助您
pdlg = ProgressDialog.show(getParent(), "Loading...", "");
WindowManager.LayoutParams lp = pdlg.getWindow().getAttributes();
p.dimAmount=0.0f; //Dim Amount
pdlg.getWindow().setAttributes(lp); //Applying properties to progress dialog
pdlg.dismiss(); //Dismiss the dialog
1
嘿,你可以设置系统,亮度是这样的:
//Set the system brightness using the brightness variable value
System.putInt(cResolver, System.SCREEN_BRIGHTNESS, brightness);
//Get the current window attributes
LayoutParams layoutpars = window.getAttributes();
//Set the brightness of this window
layoutpars.screenBrightness = brightness/(float)255;
//Apply attribute changes to this window
window.setAttributes(layoutpars);
或者,你可以参考这个完整tutorial
相关问题
- 1. Android的设置屏幕亮度为0关闭屏幕 - 如何避免
- 2. 控制屏幕设置(除了亮度)
- 3. C#设置屏幕亮度Windows 7
- 4. Android屏幕类型/亮度
- 5. 试图在Android手机上设置屏幕亮度
- 6. 如何在WP7上设置屏幕的亮度
- 7. 如何在Android应用程序内部设置屏幕亮度本地
- 8. Android中的屏幕亮度值
- 9. 如何设置屏幕亮度为DialogInterface它
- 10. 如何在Android中更改手机主屏幕的亮度?
- 11. Android 2.2:调整屏幕亮度
- 12. Android屏幕亮度最大值?
- 13. iOS:在应用处于后台时设置屏幕亮度
- 14. 如何处理屏幕亮度
- 15. 如何调暗屏幕亮度完全
- 16. 如何为小屏幕和大屏幕设置webview宽度
- 17. Android:如何在android棒棒糖中打开设置屏幕
- 18. 如何在android中设计屏幕?
- 19. 如何检索当前系统Android的屏幕亮度值?
- 20. 在Android的webview中操作屏幕亮度
- 21. 在Android模拟器中更改屏幕亮度
- 22. 在android中以编程方式更改屏幕亮度
- 23. WP7中的控制屏幕亮度
- 24. 如何在Android中设计任何屏幕大小和密度(Android中的多屏幕手机)
- 25. 如何在android中设置屏幕底部的标签?
- 26. 如何在适合50%屏幕的android中设置图像
- 27. 无法应用系统屏幕亮度编程中的Android
- 28. Android短屏亮度代码!
- 29. 以编程方式在Android上设置屏幕密度
- 30. 在Android设备中使行高度与屏幕高度相等
你可以用” t在全球范围内调整屏幕亮度;注意这个问题http://stackoverflow.com/questions/6158628/android-short-screen-brightness-code –
是啊..它只适用于你的窗口。 – Ronnie