I want to enable kiosk mode to my app. I have AdminReceiver.java in the same package with MainActivity.java. I already factory reset my phone, installed the app and then ran this command to make my app as device owner.
adb shell dpm set-device-owner com.azecsoft.azeckiosk/.AdminReceiver
But, somehow I keep getting error message like this :
Error: Unknown admin: ComponentInfo{com.azecsoft.azeckiosk/com.azecsoft.azeckiosk.AdminReceiver}
This is how I set up the receiver in AndroidManifest.xml.
<receiver
android:name=".AdminReceiver"
android:label="@string/app_name"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>
Am I missing a step? Please help me, thank you.