I trying to add a button beside HealthyApp, but no luck .
This is my initial code and image
final ActionBar actionBar = getSupportActionBar();
In your Activity layout
In your Activity
public class YourActivity extends ActionBarActivity {
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.your_acticity_layout);
// Set a Toolbar to replace the ActionBar.
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
// ... your other methods
}
In your Manifest, Activity tag
In your style.xml
If you need a better code sample: Just download https://github.com/chrisbanes/cheesesquare , It has the example toolbar.