<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
</menu>
Se invece, aggiungessimo:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Item" />
</menu>
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Aggiorna"
/>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Aggiorna"
android:id="@+id/aggiorna"
/>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Aggiorna"
android:id="@+id/aggiorna"
android:orderInCategory="100"
/>
</menu>
icona creata. Quindi?
<?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:title="Aggiorna"
android:id="@+id/aggiorna"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/aggiorna"
/>
</menu>
E’ bene ora creare altre icone.
Notiamo solo che nel realizzare l’Action Bar, la prima icona di sistema, che abbiamo inserito nel realizzare appunto, l’Action Bar, si vede poco bene. Questo è un cattivo funzionamento da parte del Material Design.
<?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:title="Aggiorna"
android:id="@+id/aggiorna"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/aggiorna"
/>
<item android:title="miaFunz"
android:id="@+id/miaFunz"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/icona_miabo"
/>
</menu>
Se inserissimo anche la terza funzione ?
<?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:title="Aggiorna"
android:id="@+id/aggiorna"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/aggiorna"
/>
<item android:title="miaFunz"
android:id="@+id/miaFunz"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/icona_miabo"
/>
<item android:title="funzGiacchio"
android:id="@+id/ghiacciof"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/icona_nuova"
/>
</menu>
Se dovessimo inserire una Terza Funzione, ovvero icona di Sistema, allora, ci apparirà Action Overflow
E’ apparsa ovviamente l’Action Overflow
<?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:title="Aggiorna"
android:id="@+id/aggiorna"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/aggiorna"
/>
<item android:title="bluetooth"
android:id="@+id/bluetooth"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/icona_k"
/>
<item android:title="miaFunz"
android:id="@+id/miaFunz"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/icona_miabo"
/>
<item android:title="funzGiacchio"
android:id="@+id/ghiacciof"
android:orderInCategory="100"
app:showAsAction="ifRoom"
android:icon="@drawable/icona_nuova"
/>
</menu>