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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:32:52+00:00 2026-06-13T06:32:52+00:00

I’m trying to use this flag SYSTEM_UI_FLAG_LOW_PROFILE on a view. My problem goes deeper

  • 0

I’m trying to use this flag SYSTEM_UI_FLAG_LOW_PROFILE on a view. My problem goes deeper than that though. My real problem is that I’m really bad at navigating the documentation to find out how to actually implement this. I find myself in this predicament a lot. Can anyone tell me how to learn how to set a flag, but by using the documentation and not looking for someone to post some sample code for me to “steal”? Let’s say all I had was eclipse and all of the downloaded android documentation, and I didn’t know how to set this, how could I learn? This is more of a “learning to program” type of question, but a genuine question nonetheless and I hope someone can help me out.

The best I can comeup with from reading the documentation:

setContentView(R.layout.start);
setSystemUiVisibility(SYSTEM_UI_FLAG_LOW_PROFILE):
  • 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-13T06:32:54+00:00Added an answer on June 13, 2026 at 6:32 am

    I have to work offline quite often (while travelling) and am quite experienced problem-solving with just the reference documentation; so it is possible! I’ll start with a quick overview of the Android SDK Reference, and ease into some information about flags while preserving your chance (and hopefully tools) to solve your particular problem yourself.

    Most API reference documents, especially those generated using Javadoc-type tools, follow similar conventions; so once you’re comfortable with Android’s reference documentation, you should be able to translate other documentation as well.

    I recommend you bookmark the package index page (if you haven’t already) of your reference documentation:

    • http: // developer.android.com/reference/packages.html -or-
    • {your local "android-sdk" folder}/docs/reference/packages.html.

    On Windows, the full default path should be similar to:

    • file:///C:/Program%20Files/Android/android-sdk/docs/reference/packages.html -or-
    • file:///C:/Program%20Files%20(x86)/Android/android-sdk/docs/reference/packages.html
    • Header Search Box: The search box in the upper right is great for searching the documentation.
    • When online, a search for "flags" will result in all references throughout the documentation.
    • When offline, the search box will only provide hints/links for form of package and class names; typing "intent" will offer "android.content.Intent", but you will find "flags" decidedly unhelpful.

    Packages Index Page

    On the left you’ll find the Android Packages List with links to each package, while the body of the page lists the packages with a short introduction and link to each.

    Package Pages

    Clicking on a package (such as "android.content") will bring up a page summarizing the package and its contents, as well as populating the Package Contents List (beneath the Android Packages List) with the package’s constituent interfaces, exceptions, and classes such as "Intent".

    Class Pages

    Example: Intent class

    • http: // developer.android.com/reference/android/content/Intent.html
    • android-sdk/docs/reference/android/content/Intent.html

    Clicking on a interface, exception, or class (such as "Intent") will bring up an extremely long page of information about it. At the top of each class page you’ll find the Class Definition (aka Signature) followed by the Class Overview section which explains the object’s purpose and implementation. There is also a list of jump links to the other sections of the page:

    Nested Classes | Constants | Inherited Constants | Fields | Ctors | Methods | Inherited Methods

    Finding Useful References

    If you don’t know what you’re looking for, I suppose you can start reading pretty much anywhere; but given a specific need, such as implementing flags, a basic knowledge of OOP will get you started.
    Since you want to learn how to add flags (actions are Methods) to a View (an Object,) looking at the Methods for a View is an excellent place to start your search, as is View’s Class Overview section.

    I’ll leave View for you to read later since you said you wanted to learn how to learn 🙂

    Browser Search: Don’t forget to make use of your browser’s built-in search feature, often [CTRL]+[F] on windows. Searching for a term such as "flag" will allow us to quickly browse through all occurrences of it (217 of flag!) on the page, but you can quickly try a few related terms and phrases (the more precise the better) to get a more refined/reduced match set, then iterate through some. By quickly trying a few more terms, I was able to find what I wanted: "flags"(67), "add flag"(0), and "addflag"(6 matches – winner!)

    Navigating a Class Page

    Continuing to use the android.content.Intent class page as an example, clicking the jump link for Methods will quickly reveal addFlags(), and a bit of scrolling will reveal setFlags(). Both methods take a single int as their argument; however, the text refers to this single int using the plural name "flags" for good reason: you can squeeze quite a few flags into a single int, because each flag is stored as a specific bit! (I’ll explain this a bit more below.)

    At the bottom of each method is a "see also" subsection that often contains usefully related links. Both the flag methods we found, addFlags() and setFlags(), reference each other in their "see also" section, and setFlags() also contains links to all of the relevant flag constants. These flag constants, each have a name beginning with "FLAG_" by convention. Here are the "Constants" entries for a couple commonly used intent flags:

    • int FLAG_ACTIVITY_NEW_TASK If set, this activity will become the start of a new task on this history stack.

    • int FLAG_ACTIVITY_CLEAR_TOP If set, and the activity being launched is already running in the current task, then instead of launching a new instance of that activity, all of the other activities on top of it will be closed and this Intent will be delivered to the (now on top) old activity as a new Intent.

    Clicking on the constants’ names will jump us further down the page, to where each of these constants is explained in greater detail including listing their actual values in both base-10 (decimal) and base-16 (hex).

    Remember that Java uses a C-style prefix of ‘0x’ to differentiate hexadecimal numbers, and that this prefix does not affect the value aside from identifying it’s numeric base.

    • FLAG_ACTIVITY_NEW_TASK shows a constant value of 268435456 (0x10000000).
    • FLAG_ACTIVITY_SINGLE_TOP has a constant value of 536870912 (0x20000000).

    These numbers may seem random and arbitrary, but they aren’t – each is actually a single switched-on bit in an otherwise zero byte, making our flags in base-2 (binary) seem more logical:

    • 00010000000000000000000000000000 and
    • 00100000000000000000000000000000.

    How to Add and Set Flags in a bit-mask

    To apply both to an intent, you can use either setFlags (discard pre-existing flags) or addFlags (keep all flags) like so:

    • someExampleIntent.setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_SINGLE_TOP);
    • Take special notice of the vertical bar, "|", between our flags; in Java it is the "bitwise-or" operator.

    Basically, the bitwise-or does a bit-by-bit comparison of the input int’s that returns true(1) if any comparison bit is true, otherwise returning false(0). bitwise-or, Yea!

    So bitwise-or comparison of our bit-masks will yield:

    • 00010000000000000000000000000000 |
    • 00100000000000000000000000000000 =
    • 00110000000000000000000000000000

    Be careful to never use addition (+) with bit-masks! It’s perfect for creating intermittent bugs; it will yield the same result as bitwise-or when merging two numbers.. (hold for the exception – literally):

    • 00010000000000000000000000000000 +
    • 00100000000000000000000000000000 =
    • 00110000000000000000000000000000 (same result as bitwise-or)

    ..EXCEPT if the masks you add have any set bits in common, such as adding FLAG_ACTIVITY_SINGLE_TOP to a bit-mask that already contains it- then we get pictures of crying kittens or some-such nonsense:

    • 00110000000000000000000000000000 +
    • 00100000000000000000000000000000 =
    • 01010000000000000000000000000000 /!\ Oops.

    Accidentally removed FLAG_ACTIVITY_SINGLE_TOP and accidentally added FLAG_ACTIVITY_NO_HISTORY; two errors for the price of one keystroke!

    Please, do the right thing(tm) and use ‘|’ (not ‘+’) for merging bit-masks.

    Here’s a simple Java example of bitwise-or and the pitfalls of using addition on them.

    Just found an excellent explanation of bit-masks, too.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I know there's a lot of other questions out there that deal with this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I

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.