Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.34 KB | None | 0 0
  1. This is my xml file:
  2.  
  3.     <?xml version="1.0" encoding="utf-8"?>
  4.     <menu xmlns:android="http://schemas.android.com/apk/res/android">
  5.         <item
  6.             android:id="@+id/settings_id"
  7.             android:title="@string/settings"
  8.             android:showAsAction="always"
  9.             />
  10.         <item
  11.             android:id="@+id/about_us_id"
  12.             android:title="@string/about_us"
  13.             android:showAsAction="never"
  14.             />
  15.         <item
  16.             android:id="@+id/rate_id"
  17.             android:title="@string/rate_us"
  18.             android:showAsAction="never"
  19.             />
  20.     </menu>
  21.  
  22. These is my onCreateOptionsMenu() and onCreate() methods:
  23.  
  24.     @Override
  25.     public boolean onCreateOptionsMenu(Menu menu) {
  26.         menu.clear();
  27.         getMenuInflater().inflate(R.menu.main_menu, menu);
  28.         super.onCreateOptionsMenu(menu);
  29.         return true;
  30.     }
  31.  
  32.  
  33.     @Override  
  34.     protected void onCreate(Bundle savedInstanceState) {
  35.         super.onCreate(savedInstanceState);
  36.         setContentView(R.layout.activity_maps);
  37.         // Obtain the SupportMapFragment and get notified when the map is ready to be used.
  38.         SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
  39.                 .findFragmentById(R.id.map);
  40.         mapFragment.getMapAsync(this);
  41.  
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement