このスクリーン ショットのように、例の右側にあるアクション バーにボタンを追加します。
onCreate メソッドで次のように actionBar を取得します。
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
以下のように戻るボタン(onOptionsItemSelectedメソッド):
public boolean onOptionsItemSelected(MenuItem item){
Intent myIntent = new Intent(getApplicationContext(),MainActivity.class);
startActivityForResult(myIntent, 0);
return true;
}
ボタンを追加するにはどうすればよいですか?