Android Question Kiosk Mode stopped working

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Guys

I was testing the code below few weeks ago and I am sure it was all working fine:
https://www.b4x.com/android/forum/threads/device-owner-tasklock-kiosk-apps-2017.81765/

I am trying it today and I am running into some issues.

Please see log
B4X:
Error occurred on line: 64 (Main)
java.lang.reflect.InvocationTargetException
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:131)
     at b4a.example.main._btnlock_click(main.java:420)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
     at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
     at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
     at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
     at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
     at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
     at android.view.View.performClick(View.java:4783)
     at android.view.View$PerformClick.run(View.java:19888)
     at android.os.Handler.handleCallback(Handler.java:739)
     at android.os.Handler.dispatchMessage(Handler.java:95)
     at android.os.Looper.loop(Looper.java:135)
     at android.app.ActivityThread.main(ActivityThread.java:5254)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:917)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)
Caused by: java.lang.SecurityException: No active admin ComponentInfo{b4a.example/anywheresoftware.b4a.objects.AdminReceiver2}
     at android.os.Parcel.readException(Parcel.java:1546)
     at android.os.Parcel.readException(Parcel.java:1499)
     at android.app.admin.IDevicePolicyManager$Stub$Proxy.setLockTaskPackages(IDevicePolicyManager.java:4222)
     at android.app.admin.DevicePolicyManager.setLockTaskPackages(DevicePolicyManager.java:3306)
     ... 25 more
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**


Any ideas what could be wrong?

Thanks
iCAB
 

DonManfred

Expert
Licensed User
Longtime User
Do you really have a kiosk app b4a.example?
You are maybe overwriting it by any example found? Usually it is this packagename
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
Do you really have a kiosk app b4a.example?
You are maybe overwriting it by any example found? Usually it is this packagename
Hi Don
Thanks for your reply.
I just recompiled with a different package name and got the same error
 
Upvote 0
Top