Java code:
write this in onCreate()
getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().setCustomView(R.layout.action_bar);
and for you custom view, simply use FrameLayout, east peasy!
android.support.v7.widget.Toolbar is another option
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/app_name"
android:textColor="@color/black"
android:id="@+id/textView" />
</FrameLayout>