addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Re: [informal-android-dev] ActionBar and forcing items into the overflow menu

From: Elizabeth M.
Sent on: Sunday, July 1, 2012, 8:11 AM
Hi Anuj,

Have you reviewed the developers blog?
http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html

Overflow won't show if your device has a menu button.  The menu button works for overflow items instead.  ActionBar Sherlock may be a workaround if you really want both.  There are caveats for upgraded device compatibility with regards to the action bar.  The blog says:

If your app runs on a device without a dedicated Menu button, the system decides whether to add the action overflow to the navigation bar based on which API levels you declare to support in the <uses-sdk> manifest element. The logic boils down to...<read the article>


Cheers!
<B

--- On Sun, 7/1/12, Anuj Goyal <[address removed]> wrote:

From: Anuj Goyal <[address removed]>
Subject: [informal-android-dev] ActionBar and forcing items into the overflow menu
To: [address removed]
Date: Sunday, July 1, 2012, 7:47 AM

I am trying to force "reset" to show up in ActionBar's overflow (3 vertical dots). The appearance of summary is correct, but I can't seem to make the overflow appear.  What set of enums do I need for android:showAsAction?  I have tried these 3 variants but none give the desired result:

android:showAsAction="ifRoom|withText"
android:showAsAction="never|withText"
android:showAsAction="always|withText"

Maybe it's user error, but this would be useful to add to the docs

I have also looked on stackoverflow and have not found anything directly answering this question.

Inline image 3

<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:id="@+id/menu_reset"
        android:icon="@drawable/ic_menu_reset"
        android:showAsAction="ifRoom|withText"
        android:title="@string/menu_reset"/>
    <item
        android:id="@+id/menu_summary"
        android:icon="@drawable/ic_menu_summary"
        android:showAsAction="always"
        android:title="@string/menu_summary"/>
</menu>

public class MainActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activitymain);

ActionBar actionBar = getActionBar();
actionBar.show();
return;
}




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Anuj Goyal ([address removed]) from Informal Android Developer Meetup.
To learn more about Anuj Goyal, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

People in this
group are also in: