0
Good afternoon,
I created a project with the tamplete "Navigation Drawer Activity" and I would like to know how by action to the menu of the 3 dots -> Sttings of the top, I tried as follows:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
menu.getItem(0).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
Toast.makeText(getBaseContext(), "ola", Toast.LENGTH_SHORT);
}
});
return true;
}