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 7592941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:02:14+00:00 2026-05-30T21:02:14+00:00

My Question is similar to this one How can I wake an android device

  • 0

My Question is similar to this one
How can I wake an android device up and skip the screenlock

I want to display a dialogue box from broadcast receiver, but Android API is not allowing me to do that therefore I am using starting an activity from there and changing the theme of this activity to Theme.

Now I want this activity to be displayed even when phone is in locked mode/ sleep mode.

Screen I am able to turn on bu using below flags but Key Guard (Non Secured) I have to unlock manually. I am not able to see my window over locked screen.

The difference is that I am not using a full screen Activity i.e.

android:theme="@android:style/Theme.Dialog

in my code I am using

Window w = getWindow();
w.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | 
           WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | 
           WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
  • 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-05-30T21:02:16+00:00Added an answer on May 30, 2026 at 9:02 pm

    I don’t succeed in achieving this feature by using these Flags, but I did succeed by using the WakeLock and KeyguardLock. Below is what I do:

    public class DismissLock extends Activity {
    
    PowerManager pm;
    WakeLock wl;
    KeyguardManager km;
    KeyguardLock kl;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        Log.i("INFO", "onCreate() in DismissLock");
        pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
        km=(KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE);
        kl=km.newKeyguardLock("INFO");
        wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP|PowerManager.ON_AFTER_RELEASE, "INFO");
        wl.acquire(); //wake up the screen
        kl.disableKeyguard();// dismiss the keyguard
    
        setContentView(R.layout.main);
    
    }
    
    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        wl.release(); //when the activiy pauses, we should realse the wakelock
    }
    
    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        wl.acquire();//must call this!
    }
    
    }
    

    Of course, you still need to declare the permission in the manifest file.

    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is similar to this one , but I can simplify it some.
This question is very similar to this one Why can't I dynamic_cast "sideways" during
I have a similar question to this one SQL products/productsales I want to do
Preamble: My core question is very similar to this one: How can I write
This question is similar to this one How do I add options to a
My question is similar to this one , but I would like to replicate
My question is similar to this one but none of the answers solve my
This question is similar to this other one , with the difference that the
This is a similar question to this one . I would like to convert
This is a similar question to this one here . Given a list of

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.