I want to add a Button to the Action Bar to the right hand side of Example as in this screen shot:
I get actionBar in onCreate method as:
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
and back button(onOptionsItemSelected method) as below:
public boolean onOptionsItemSelected(MenuItem item){
Intent myIntent = new Intent(getApplicationContext(),MainActivity.class);
startActivityForResult(myIntent, 0);
return true;
}
How can I add button?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…