I have a map in my android app. By default it shows the satellite view, but I have turned it off to only show the road maps view. However, I am wondering how I would constru
Just add this to your Activity:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_items, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.item1 :
//do what you like
default :
return super.onOptionsItemSelected(item);
}
}
This should be in a separate xml file (maybe /res/menu/menu_items.xml)