Android Support ライブラリの Actionbar にボタンを追加したい。アクションバーは表示されますが、ボタンは表示されません。
以下は res/menu/main.xml です
menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="always"
android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/action_settings"/>
</menu>
次のコードを追加します。
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
MenuInflater inflater=getMenuInflater();
inflater.inflate(R.menu.main, menu);
return true;
}
私は何をすべきか??