hi
i try to change the brightness from a Service but i get a NullPointerException.
this is the code:
this is the log:
i try to change the brightness from a Service but i get a NullPointerException.
this is the code:
B4X:
phone1.SetScreenBrightness(0.1)
this is the log:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
*** Service (screenshieldsrv) Create ***
** Service (screenshieldsrv) Start **
No wakelock.
** Activity (settings) Create, isFirst = true **
Panel size is unknown. Layout may not be loaded correctly.
** Activity (settings) Resume **
** Activity (settings) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
Error occurred on line: 182 (ScreenShieldSrv)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
at anywheresoftware.b4a.phone.Phone.SetScreenBrightness(Phone.java:186)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:259)
at www.sagital.scrshield.screenshieldsrv._updatemypnl(screenshieldsrv.java:652)
at www.sagital.scrshield.screenshieldsrv._statusow_touch(screenshieldsrv.java:628)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runGoodChain(Shell.java:463)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:285)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at b4a.flm.overlaywdw.OverlayWindow$1.onTouch(SourceFile:75)
at android.view.View.dispatchTouchEvent(View.java:9987)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2828)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2499)
at android.view.View.dispatchPointerEvent(View.java:10228)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5344)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5180)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4673)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4639)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4781)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4647)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4838)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4673)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4639)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4647)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4620)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7306)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7184)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7145)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7416)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)