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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:42:29+00:00 2026-06-05T05:42:29+00:00

I added preference-headers to my app so that the preference screen would not look

  • 0

I added preference-headers to my app so that the preference screen would not look broken on Honeycomb and tablet sized ICS. However, I only have one header at the moment so you have to click through a header screen with only one entry on phone sized devices. Is there an easy way to tell android to skip the header screen when there’s only one header, but to still show it on large screens?

It seems that the stock Contacts app does this successfully but I’ve browsed through its source and can’t figure out how it is doing it.

  • 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-05T05:42:29+00:00Added an answer on June 5, 2026 at 5:42 am

    You can skip the headers by setting one of your PreferenceFragments as default.

    When you take a look at the PreferenceActivity.java source, you will find these two extras:

    /**
     * When starting this activity, the invoking Intent can contain this extra
     * string to specify which fragment should be initially displayed.
     */
    public static final String EXTRA_SHOW_FRAGMENT = ":android:show_fragment";
    
    /**
     * When starting this activity, the invoking Intent can contain this extra
     * boolean that the header list should not be displayed.  This is most often
     * used in conjunction with {@link #EXTRA_SHOW_FRAGMENT} to launch
     * the activity to display a specific fragment that the user has navigated
     * to.
     */
    public static final String EXTRA_NO_HEADERS = ":android:no_headers";
    

    Now simply add these two extras to the intent which is invoking your PrefenceActivity and specify the PreferenceFragment which should be shown by default as follows:

    Intent intent = new Intent( this, Preferences.class );
    intent.putExtra( PreferenceActivity.EXTRA_SHOW_FRAGMENT, PreferencesFragment.class.getName() );
    intent.putExtra( PreferenceActivity.EXTRA_NO_HEADERS, true );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a project which as a reference added to System.Web. However, it can't
I have added a ListBox to a SHEET (not to a UserForm) I did
I am using Visual Studio 2008 and have added a web reference that points
I have successfully created a WS client that works correctly when NOT using authentication.
I've got a Jquery function that I wrote which blacks out the screen after
In Eclipse, I added the path Windows-> Preference -> Java ->Build Path -> Classpath
I've added the reference to System.Runtime.Serialization dll to my project but still can't find
I have MapPoint 2009 installed and added a reference to the Microsoft MapPoint 16.0
I've created a project, added a reference to System.Drawing, and added a bmp file
I have a WCF service running, I added a reference to the service by

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.