I am creating an application and I need to put buttons in the ActionBar
and I already did it but I do not know how to put images on the buttons and only text (see image) the question is that in XML if it is done but in this case I can not use XML, just Java, any ideas on how to do it with Java alone?
Code that I am using (this is also the one of the overflow menu):
android.support.v7.widget.SearchView searchview;
ArrayAdapter<String> adapter;
@Override
public boolean onCreateOptionsMenu (Menu menu){
menu.add(0, 0, 0, "Notificar");
menu.add(0, 1, 1, "Test de velocidad");
menu.add(0, 2, 2, "Salir");
menu.add(0,3,3,"Refrescar").setActionView(searchview).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
menu.add(0,4,4,"Ayuda").setActionView(searchview).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
return true;
}