Hello folks,
I try to use the goToSleep method from the OSLibrary, but I always get this error:
the code lines I used:
and the manifest entry:
any idea whats missing?
THX
M
I try to use the goToSleep method from the OSLibrary, but I always get this error:
B4X:
main_button1_click (B4A line: 63)
OS.goToSleep(0)
java.lang.SecurityException: Neither user 10046 nor current process has android.permission.DEVICE_POWER.
at android.os.Parcel.readException(Parcel.java:1327)
at android.os.Parcel.readException(Parcel.java:1281)
at android.os.IPowerManager$Stub$Proxy.goToSleep(IPowerManager.java:316)
at android.os.PowerManager.goToSleep(PowerManager.java:456)
at com.rootsoft.oslibrary.OSLibrary.goToSleep(OSLibrary.java:777)
at aa.aa.aa.main._button1_click(main.java:273)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:145)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:133)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:129)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:53)
at android.view.View.performClick(View.java:3516)
at android.view.View$PerformClick.run(View.java:14110)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4429)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
at dalvik.system.NativeStart.main(Native Method)
java.lang.SecurityException: Neither user 10046 nor current process has android.permission.DEVICE_POWER.
Flushing caches (mode 0)
the code lines I used:
B4X:
Dim OS As OperatingSystem
Sub Button1_Click
OS.goToSleep(0)
End Sub
and the manifest entry:
B4X:
AddPermission(android.permission.DEVICE_POWER)
any idea whats missing?
THX
M