//Toolbar hide and show
getActionBar().hide();
getActionBar().show();
//Custom toolbar
ActionBar vkn = getActionBar();
vkn.setCustomView(R.layout.custom);
vkn.setDisplayShowCustomEnabled(true);
//Toolbar set image
ActionBar tab = getActionBar();
tab.setBackgroundDrawable(getDrawable(R.drawable.image_id));
//Change toolbar title and colours
getActionBar().setTitle(Html.fromHtml("<font color='#76FF03'>Your Title</font>"));
// Toolbar Subtitle
getActionBar().setSubtitle("Subtitle");
//Subtitle Colour and your subtitle
getActionBar().setSubtitle(Html.fromHtml("<font color='#76FF03'>Your Title</font>"));
//Use search button in toolbar
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
menu.add("search") .setIcon(R.drawable.ic_page) .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); return true;
}
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getTitle().toString()) {
case "search":
_search();
return true;
default:
return super.onOptionsItemSelected(item);
}
video Help