Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is my xml file:
- <?xml version="1.0" encoding="utf-8"?>
- <menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:id="@+id/settings_id"
- android:title="@string/settings"
- android:showAsAction="always"
- />
- <item
- android:id="@+id/about_us_id"
- android:title="@string/about_us"
- android:showAsAction="never"
- />
- <item
- android:id="@+id/rate_id"
- android:title="@string/rate_us"
- android:showAsAction="never"
- />
- </menu>
- These is my onCreateOptionsMenu() and onCreate() methods:
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- menu.clear();
- getMenuInflater().inflate(R.menu.main_menu, menu);
- super.onCreateOptionsMenu(menu);
- return true;
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_maps);
- // Obtain the SupportMapFragment and get notified when the map is ready to be used.
- SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
- .findFragmentById(R.id.map);
- mapFragment.getMapAsync(this);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement