Why do not you show me the more item icon in the action bar if there is space?

0

Hello good afternoon I have a problem happens that the icon is not shown anymore (the default of android) in the action bar, if not send it to the drop-down menu there (those three dots). Here is my code: XML

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:app="http://schemas.android.com/apk/res-auto">

 <item android:id="@+id/menuAddItem"
     android:title="Add Item"
     android:icon="@android:drawable/ic_menu_add"
     app:showAsAction="ifRoom"
    />

 </menu>

and here is my java code:

  @Override
public boolean onCreateOptionsMenu(Menu menu) {
    menu.clear();
    MenuInflater infladorMenu = new MenuInflater(this);
    infladorMenu.inflate(R.menu.menu,menu);
    return true;

     }

@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()){
        case R.id.menuAddItem:
            this.listaDatos.add("Dato Añadido");
            this.adaptador.notifyDataSetChanged();
            break;
    }

    return super.onOptionsItemSelected(item);
}

As you can see it does not show me the icon but it sends it to the dropdown of three dots and I do not understand, if I see space there.

Thank you very much friends.

    
asked by David Garcia 08.11.2018 в 19:57
source

0 answers