Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hy Guys!


I want to make an app with a map view in it, and i want to ad 2 buttons to the action bar!
So i tried everything from the developer pages guied and nothing works...



without any affect..

public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.main, menu);

// Calling super after populating the menu is necessary here to ensure that the
// action bar helpers have a chance to handle this event.
return super.onCreateOptionsMenu(menu);
}

xml :


<menu xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:yourapp="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/action_search">
android:icon="@drawable/ic_action_search"
android:title="Search"
yourapp:actionProviderClass="android.support.v7.widget.ShareActionProvider"
yourapp:showAsAction="always"/>
<item android:id="@+id/action_compose">
android:icon="@drawable/ic_action_refresh"
android:title="Try Once again"
yourapp:actionProviderClass="android.support.v7.widget.ShareActionProvider"
yourapp:showAsAction="ifRoom"/>



i want this 2 buttons to be in tha action bar at the rigth side..
Somebody please help me :)
Thanks a lot !
Posted

1 solution

Check[^] for adding Google Map V2 into Activity

A very good article about ActionBar

ActionBar[^]

Hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900