title: AppcompatActivity with toolbar not showing toolbar after apprunning but shows on xml preview android studio
body: <p>I have already worked with AppcompatActivity and integrate android.support.v7.widget.Toolbar . But for the very first time I am having a unknown problem . my toolbar is showing in xml preview , but after running the app the toolbar disappeared . here is my code and style file .here are three files MainActivity , layout file and style file from values folder `public class MainActivity extends AppCompatActivity {</p>
  
  <pre><code>    @Override
      public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
          super.onCreate(savedInstanceState, persistentState);
          setContentView(R.layout.activity_main);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
      }
  }`
  </code></pre>
  
  <p>and in layout file , I removed my code just write the toolbar part for clarity , and is style file Apptheme.base theme is the parent theme which is inherited by values-v21/style.xml  </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:context=".MainActivity"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:popupTheme="@style/AppTheme.PopupOverlay"&gt;
  
              &lt;!--&lt;RelativeLayout
                  android:id="@+id/rl_toolbar_main"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"&gt;
  
  
                  &lt;ImageView
                      android:id="@+id/tv_home_header"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_centerInParent="true"
                      android:layout_centerHorizontal="true"
                      android:layout_centerVertical="true"
                      android:drawablePadding="10dp"
                      android:src="@mipmap/ic_launcher" /&gt;
              &lt;/RelativeLayout&gt;--&gt;
  
  
          &lt;/android.support.v7.widget.Toolbar&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;/RelativeLayout&gt;
  
  in values/style.xml
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;!-- Base application theme. --&gt;
  &lt;style name="AppTheme" parent="AppTheme.base"&gt;
      &lt;!-- Customize your theme here. --&gt;
      &lt;item name="android:colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="android:colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name="android:colorAccent"&gt;@color/colorAccent&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="Button" parent="AppTheme.base"&gt;
      &lt;item name="android:textColor"&gt;#ffffff&lt;/item&gt;
      &lt;item name="android:padding"&gt;0dp&lt;/item&gt;
      &lt;item name="android:minWidth"&gt;88dp&lt;/item&gt;
      &lt;item name="android:minHeight"&gt;36dp&lt;/item&gt;
      &lt;item name="android:layout_margin"&gt;3dp&lt;/item&gt;
      &lt;item name="android:elevation"&gt;1dp&lt;/item&gt;
      &lt;item name="android:translationZ"&gt;1dp&lt;/item&gt;
      &lt;item name="android:background"&gt;@drawable/primary_round&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;resources&gt;
  
  &lt;!-- Base application theme. --&gt;
  &lt;style name="AppTheme" parent="AppTheme.base"&gt;
      &lt;!-- Customize your theme here. --&gt;
      &lt;item name="android:colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="android:colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name="android:colorAccent"&gt;@color/colorAccent&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>