I launch the set password activity by using the intent DevicePolicyManager.ACTION_SET_NEW_PASSWORD. When the user sets a password I want to be notified (basically then my app knows that the master passcode is set for the device). However, in my onActivityResult function I get a RESULT_CANCELLED action when the user tries to set a new PIN or alphanumeric password. I have only observed this with Android version 4.0.4. Does anyone know how I can find if the user has set a PIN or a alphanumeric password on ICS?
I launch the set password activity by using the intent DevicePolicyManager.ACTION_SET_NEW_PASSWORD . When the
Share
After some research I found this solution. Make a class to extend the
android.app.admin.DeviceAdminReceiverto listen for any change associated with the device master password. Override thepublic void onPasswordChanged(Context context, Intent intent)method to receive a call back when there is a change in the passcode. The following code foronPasswordChangedworked for me.Use masterPasswordEnabled even if the resultCode is
RESULT_CANCELLED.