I am starting up the ActionSetNewPassword
action via an Intent
. On return I am watching for OK
and running some code or CANCEL
and closing.
This was working fine but now I am being returned RESULT_FIRST_USER
rather than OK
when I successfully deal with the action.
Why would I be now being passed back RESULT_FIRST_USER
?
What is that result code supposed to tell me?
EDIT
I am using Xamarin and MVVMCross to start the activity. This has been all working fine I would just like to know under what circumstances Android would send back RESULT_FIRST_USER
Intent actionSetNewPasswordIntent =
new Intent(DevicePolicyManager.ActionSetNewPassword);
this.context.StartActivityForResult(
actionSetNewPasswordIntent,
20);
In the Activity I am listening for the return like so
if (requestCode == 20)
{
if (resultCode == Result.Ok)
{
if (this.spm.CheckCompliance() != SecurityPolicyCompliance.Compliant)
{
// This should not happen as by now we have applied for Device Admin
// and sent them to SetNewPassword where they have not cancelled
this.Finish();
}
}
else if (resultCode == Result.Canceled)
{
// User backed away from changing password.
this.Finish();
}
}
else
{
base.OnActivityResult(requestCode, resultCode, data);
}
Thanks