Screen Brightness

edited December 2016 in Android Mode

I'm trying to set screen brightness maximum but i couldn't do it somehow.

Here is my code:

` void setup(){ fullScreen(JAVA2D);

WindowManager.LayoutParams lp = getActivity().getWindow().getAttributes(); lp.screenBrightness = 1; getActivity().getWindow().setAttributes(lp); } `

void draw(){ //somestuff }

When i run it, application crashes on the phone. Then in the console;

android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. at android.view.ViewRootImpl.checkThread( at android.view.ViewRootImpl.requestLayout( at android.view.View.requestLayout( at android.view.View.setLayoutParams( at android.view.WindowManagerGlobal.updateViewLayout( at android.view.WindowManagerImpl.updateViewLayout( at at android.view.Window.dispatchWindowAttributesChanged( at at android.view.Window.setAttributes( at processing.test.sketch_161217b.sketch_161217b.setup( at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source) at Source) at


Sign In or Register to comment.