Android examples for android.app:Toolbar
Create Plain Toolbar No Title
import android.app.Activity; import android.support.annotation.IdRes; import android.support.annotation.LayoutRes; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; public class Main{ public static Toolbar getToolbarPlainNoTitle(Activity activity, @IdRes int toolbarResId) { Toolbar layoutToolbar = (Toolbar) activity .findViewById(toolbarResId); Toolbar result = (Toolbar) activity .findViewById(R.id.tablet_toolbar); if (result != null) { if (layoutToolbar != null) { layoutToolbar.setVisibility(View.GONE); }/*from w w w.j a v a 2 s . c om*/ ((TextView) activity.findViewById(R.id.toolbar_title)) .setText(activity.getTitle()); return result; } layoutToolbar.setTitle(null); return layoutToolbar; } }