Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8306073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:15:25+00:00 2026-06-08T18:15:25+00:00

I launch the set password activity by using the intent DevicePolicyManager.ACTION_SET_NEW_PASSWORD . When the

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:15:27+00:00Added an answer on June 8, 2026 at 6:15 pm

    After some research I found this solution. Make a class to extend the android.app.admin.DeviceAdminReceiver to listen for any change associated with the device master password. Override the public void onPasswordChanged(Context context, Intent intent) method to receive a call back when there is a change in the passcode. The following code for onPasswordChanged worked for me.

    public class MyDeviceAdminReceiver extends android.app.admin.DeviceAdminReceiver {
    
    
    @Override
    public void onPasswordChanged(Context context, Intent intent) {
        super.onPasswordChanged(context, intent);
    
        Log.d(TAG, "onPasswordChanged:");
        boolean masterPasswordEnabled = false;
        ComponentName component = new ComponentName(context, MyDeviceAdminReceiver.class);
        DevicePolicyManager devPolicyMan = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
    
        // Update configuration based on actual password state on the device
        if (devPolicyMan.isAdminActive(component)) {
              Log.d("master_password_debug", "admin is active");
              devPolicyMan.setPasswordMinimumLength(component, 1);
              masterPasswordEnabled = devPolicyMan.isActivePasswordSufficient();
            }
    
    }
    
    }
    

    Use masterPasswordEnabled even if the resultCode is RESULT_CANCELLED.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following command to set up the AWS launch config: as-create-launch-config test1autoscale
I have a card layout set in my app.js. here's the code; ... launch:
At the moment I'm using bat file to launch my jar and set the
I launch an activity to capture a picture from camera: Intent i = new
i launch the Default SMS Activity from my Android app in order to send
I have the following simple check whether my app is set to launch at
I have this code set to run on my app launch: NSRect rect =
My launch activity starts up another activity whose launch is set to single instance.
I've set my launch screen to only display for 1 second using the code
When I set a Launch Image , Xcode creates a copy as Default.png and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.