I tried to set my application the device_owner of my tablet (without ROOT or NFC), with the command:
adb shell dpm set-device-owner com.test.my_device_owner_app/.MyDeviceAdminReceiver
like is written on many sites (because i have to make a KIOSK APP). First of all i made a factory reset, then i installed my app, and then i wrote this command on shell, but the answer is:
java.lang.IllegalStateException: Trying to set device owner but device is already provisioned.
at android.os.Parcel.readException(Parcel.java:1554)
at android.os.Parcel.readException(Parcel.java:1499)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:3212)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:114)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.dpm.Dpm.main(Dpm.java:38)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)
Now, how can i resolve this problem without rooting the tablet?