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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:07:47+00:00 2026-06-06T03:07:47+00:00

I’m setting up lights-out mode for my android app when its running on recent

  • 0

I’m setting up “lights-out” mode for my android app when its running on recent phones and tablets. In my onCreate() method, I added:

View rootView = getWindow().getDecorView();
rootView.setSystemUiVisibility(View.STATUS_BAR_HIDDEN); // aka View.SYSTEM_UI_FLAG_LOW_PROFILE

this works better than I thought it would. On my Android 3.2 tablet the status bar starts in low profile mode (all the buttons on the bar are replaced with dots). If I interact with the buttons on the bar it will become normal, and then go back to low-profile mode afterwards (e.g., if I check the config/notifications window from the status bar). So it seems like this is more a property of my app than a “command” to hide the UI directly.

There are two corner cases that are not handled, though. First, If a user taps the status bar without hitting any of the dots, the bar becomes active. It never goes back to low profile mode until the user actually interacts with something on the bar (e.g., looks at the notifications or takes a screenshot). So, if they go back to interacting with my app, the status bar is no longer in low-profile mode. (The Gallery app seems to have this problem, too, so maybe its not just me.) The second corner case is a resume from the lock screen. If I tap the power button to lock the tablet, then unlock it and resume the app, the status bar is fully visible (and interacting with it does not change anything). (The Gallery app does not have this problem.)

A couple blog posts suggest that I could set a handler to listen for system UI visibility changes and then re-hide the UI if it becomes visible. Like this:

rootView.setOnSystemUiVisibilityChangeListener(
  new View.OnSystemUiVisibilityChangeListener() {
    @Override
    public void onSystemUiVisibilityChange(int visibility) {
      if (visibility == View.STATUS_BAR_VISIBLE) {
        game.flagUIIsVisible();
      }
    }
  });

In my case, the method on the game object just sets a flag saying the UI went invisible. Later, if there are any touch events inside my app (they’re handled by the same game object), and this flag is set, then I invoke the STATUS_BAR_HIDDEN call again.

However, with these callbacks there is no visibile impact on the UI. I can see that the right handler is being called from some log messages, and I can see the listener is being invoked.

I also tried invoking the STATUS_BAR_HIDDEN call in my onResume path, but that didn’t make a difference, either.

I’m looking for information that this is some sort of known bug, or hints for what the Gallery app might be doing (assuming its doing something differently). Or suggestions for other APIs to try (or other details that might be relevant).

I’m using libGDX, and my app only has one view, so its pretty simple. The view is also setup to be fullscreen with no title by libGDX. I’ve got my targetSdkVersion set to 15 in my manifest.

  • 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-06T03:07:48+00:00Added an answer on June 6, 2026 at 3:07 am

    I suspect there is a bug in Android 3.2, as I can work around the resume-from-lock-screen problem by re-enabling the status bar before disabling it in onResume. No OnSystemUiVisibilityChangeListener is needed.

    Specifically, in my onResume path I have code like this:

    View rootView = getWindow().getDecorView();
    rootView.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
    rootView.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
    

    The seemingly unnecessary call to make the status bar visible, seems to make the subsequent call to make the status bar hidden actually work after unlocking the device.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.