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?