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

  • SEARCH
  • Home
  • 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 8397079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:41:58+00:00 2026-06-09T20:41:58+00:00

i am developing app which check whether user has selected any screen lock pattern

  • 0

i am developing app which check whether user has selected any screen lock pattern or not .

if not i will call the intent to start activity to set the password then continue the app

so that i ask user to set the screen lock first by calling the

    Intent intent =
new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);

startActivity(intent);

  • 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-09T20:41:59+00:00Added an answer on June 9, 2026 at 8:41 pm

    Use DevicePolicyManager.isActivePasswordSufficient to check whether password is set or not.

    You need to call DevicePolicyManager.setPasswordQuality and

    DevicePolicyManager.setPasswordMinimumLength
    

    before calling this function

    Edit: Here’s the code.

    Suppose you want the user to have any password to be set then use below code.

    DevicePolicyManager  mDPM = DevicePolicyManager.getSystemService(Context.DEVICE_POLICY_SERVICE); mDeviceAdminSample = new ComponentName(ControllerActivity.this, DeviceAdminSample.class);
    
    mDPM.setPasswordQuality(mDeviceAdminSample, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING );
    if(!mDPM.isActivePasswordSufficient()){
        Intent intent = new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);
        startActivity(intent); 
    }
    

    Ofcourse you will have to have all the permissions related to device policy manager

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

Sidebar

Related Questions

I am developing an application in cocoa,which needs to check whether that app is
I'm developing the app which has input fields and whenever user enters the controll,
I am developing an app in which user has datagridview on display and he
I'm developing an app which has a large amount of related form data to
I am currently developing an app which will be on Android Market. How can
I am developing an android app where a user has to enter his login
I am developing a WP7 app, which needs online connectivity. Before navigating to any
I'm developing a facebook app which has the following structure: Browser window (facebook.com/page/xxxx) --
iTunes will not sync an app with the same or lower version , which
I'm currently developing an app which uses GPS location on googleMaps view. I check

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.