1-) Android - OPTİONS MENU (SEÇENEKLER MENÜSÜ)
1-) sol tarafta menu-->menu_main.xml in içinde
2-) android:orderInCategory="100" -->SIRALAMA DEMEK EGER "0" DERSEN İLK SIRAYA ALIR
3-) hazır icon eklemek için android:icon="@android:drawable/ic_menu_share --->"paylaş" android:icon="@android:drawable/ic_menu_preferences" -->ayarlar
android:icon="@android:drawable/ic_menu_delete" ---> sil
4-)iconu göstermek için
app:showAsAction="always" --->always olarak degıstır
app:showAsAction="ifRoom|withText" --->tavsiye edilen eger uste sıgmazsa 3 nokta şeklinde bunu yap
5-)tıklanma olayları için MainActivty.java yani OnCreatenin bulunduğu yere gel ve oradaki option metodunu aşşağıdaki gibi yap
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
Toast.makeText(getApplicationContext(),"ayarlar seçildi",Toast.LENGTH_SHORT).show();
return true;
}else if(id==R.id.paylas){
Toast.makeText(getApplicationContext(),"paylaş seçildi",Toast.LENGTH_SHORT).show();
return true;
}else if(id==R.id.sil){
Toast.makeText(getApplicationContext(),"sil seçildi",Toast.LENGTH_SHORT).show();
return true;
}
return super.onOptionsItemSelected(item);
}
}