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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:50:26+00:00 2026-06-11T13:50:26+00:00

There is a pulldown menu next to the theme pulldown; its hover text reads

  • 0

There is a pulldown menu next to the theme pulldown; its hover text reads “associated activity or fragment providing context”.

This (new) widget is not described (or shown) in the graphical layout editor documentation.

I assume that this is an activity or fragment that typically displays this view. But what does the layout editor do with this information? Can it somehow be used to preview action bar customizations?

enter image description here

  • 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-11T13:50:28+00:00Added an answer on June 11, 2026 at 1:50 pm

    The Android tools blog documented it as follows:

    We’ve added a new menu: The Activity chooser. This lets
    you choose the activity context to use for this layout:

    enter image description here

    When you open a layout the first time, we attempt to guess the right
    layout (by looking at your activity classes and seeing which layouts
    they reference), but you can choose a different activity here. The
    activity associated with a layout is used to pick which theme to
    render with, in the case where you’ve assigned themes to activities in
    your manifest file. You can also open the activity in the Java editor
    by choosing “Open activity name”. In the future we will also use the
    activity<->layout association to drive other features.

    I noticed after changing this value, a new tools:context attribute was added to the top-level element in the XML, which led me to this related question and answer. I’ve also entered a documentation bug report requesting that it be included in the documentation.

    That attribute is basically the persistence for the “Associated
    Activity” selection above the layout. At runtime, a layout is always
    associated with an activity. It can of course be associated with more
    than one, but at least one. In the tool, we need to know about this
    mapping (which at runtime happens in the other direction; an activity
    can call setContentView(layout) to display a layout) in order to drive
    certain features.

    Right now, we’re using it for one thing only: Picking the right theme
    to show for a layout (since the manifest file can register themes to
    use for an activity, and once we know the activity associated with
    the layout, we can pick the right theme to show for the layout). In
    the future, we’ll use this to drive additional features – such as
    rendering the action bar (which is associated with the activity), a
    place to add onClick handlers, etc.

    The reason this is a tools: namespace attribute is that this is only a
    designtime mapping for use by the tool. The layout itself can be used
    by multiple activities/fragments etc. We just want to give you a way
    to pick a designtime binding such that we can for example show the
    right theme; you can change it at any time, just like you can change
    our listview and fragment bindings, etc.

    (Here’s the full changeset which has more details on this:
    https://android-review.googlesource.com/#/c/36273/ )

    And yeah, the link Nikolay listed above shows how the new
    configuration chooser looks and works:
    http://tools.android.com/recent/newconfigchooser

    One more thing: The “tools” namespace is special. The android
    packaging tool knows to ignore it, so none of those attributes will be
    packaged into the APK. We’re using it for extra metadata in the
    layout. It’s also where for example the attributes to suppress lint
    warnings are stored — as tools:ignore.

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

Sidebar

Related Questions

There is a column that exists in 2 tables. In table 1, this column
There are nice SO question and answers about this issue, but these options didn't
There have been a few questions like this around the place but none have
In my application, I need to add this functionality that there should be an
I have been literally pulling my hair out with this one and its beginning
I have a function that take 2 parameters and outputs a select pulldown menu.
I would like to add a custom pulldown menu to the actionbar in my
I'm building a custom pulldown menu in jQuery. Now I'd like to set the
There is a moment in my app, that I need to force to show
There's a Rails 3.2.3 web application which doesn't use any database. But in spite

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.