1. Download our Official Android App: Forums for Android!

Apps adding action item button problem in master/detail flow

Discussion in 'Android Development' started by arshadaliso, Nov 20, 2012.

  1. arshadaliso

    arshadaliso Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Nov 20, 2012

    Nov 20, 2012
    1
    0
    5
    I have created a project on android 3.0 version(SDK Tools rev 21 and Plat form tools 16), now I'm unable to add action item buttons in action bar my code is :

    [HIGH]@Override
    public boolean onCreateOptionsMenu(Menu menu) {
    // TODO Auto-generated method stub

    MenuItem add = menu.add("Add City");
    MenuItem delete = menu.add("Delete");

    add.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT);
    delete.setShowAsAction(MenuItem.SHOW_AS_ACTION_WITH_TEXT);
    return super.onCreateOptionsMenu(menu);
    }[/HIGH]

    through this code the buttons are not visible, Please tell me how to get rid of this tiny bug. Thanks in advance.
     

    Advertisement

  2. Digital Controller

    Digital Controller The Real Bass Creator
    Rank:
    None
    Points:
    953
    Posts:
    12,647
    Joined:
    Sep 5, 2012

    Sep 5, 2012
    12,647
    3,553
    953
    Male
    Civil Engineer
    Cincinnati, Ohio
    Welcome to the forums arshadaliso, glad to have you here :)

    I am going to move this thread into the Android Applications development forum to receive some better assistance.

    Thanks for joining though and enjoy your stay :D
     

Share This Page

Loading...