I have a fragment and I'm putting these two methods in the class
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
menuInflater.inflate(R.menu.alerta, menu);
super.onCreateOptionsMenu(menu, menuInflater);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_item_new_quote:
// TODO put your code here to respond to the button tap
Toast.makeText(getActivity(), "ADD!", Toast.LENGTH_SHORT).show();
return true;
default:
return true;
}
}
I have an xml file that I created in the menu folder
But the icons do not want to appear in the actionbar at all ...