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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:10:20+00:00 2026-06-10T10:10:20+00:00

I’m having a go at doing an android 4+ layout for an application that

  • 0

I’m having a go at doing an android 4+ layout for an application that remotely controls another device via wifi/bluetooth. And I’m trying to use the action bar as best it can be used.

In this app’s case, I want to have a picker that selects basic system mode of operation for the remote device. And to the right of it I want an “edit setup” button. so user can either just select a mode of operation, or edit the selected mode of operation. I want the edit button right next to the picker because it makes sense to group them. These two actions surface most of the features people will normally use in the app.

I’m using the default example code for an android activity, as inserted in my project by the wizard “new>other>android activity” it has a picker already setup and working.

The issue is, that the picker gets put to the far left of the action bar, and all other action items start from the right and move to the left. I can’t seem to lock the position of the “edit” action item immediately to the right of the inserted picker.

items in menu XML look like this:

<item android:id="@+id/edit_configuration"
    android:title="Edit"
    android:orderInCategory="2"
    android:layout_gravity="left"
    android:showAsAction="always" />
<item android:id="@+id/menu_settings"
    android:title="@string/menu_settings"
    android:orderInCategory="100"
    android:showAsAction="never" />

The picker needs to be inserted using code in onCreate for the activity class.

    // Set up the action bar.
    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

    // Set up the dropdown list navigation in the action bar.
    actionBar.setListNavigationCallbacks(
            // Specify a SpinnerAdapter to populate the dropdown list.
            new ArrayAdapter(
                    actionBar.getThemedContext(),
                    android.R.layout.simple_list_item_1,
                    android.R.id.text1,
                    new String[]{
                            getString(R.string.title_section1),
                            getString(R.string.title_section2),
                            getString(R.string.title_section3),
                    }),
            this);

I’ve tried the standard layoutGravity attribute in the menu XML, but while it causes no error, it also doesn’t do anything I can see.

screenshot

If anyone knows how I can attach my edit button to the immediate right of my picker, I’d be really pleased to hear about how it can be done.

  • 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-10T10:10:22+00:00Added an answer on June 10, 2026 at 10:10 am

    The system controls the location of the action items to provide a common look and feel across all applications; in other words, there is no way to achieve this (unless someone else knows otherwise). You could, perhaps, extend the Action Bar, or in some way rewrite it to allow for the repositioning of action items, but that is beyond my skill.

    • 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 am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.