title: Creating a textView below an action bar
body: <p>I am quite new to android programming. As I follow the tutorials here,<a href="https://developer.android.com/training/basics/actionbar/overlaying.html" rel="nofollow">https://developer.android.com/training/basics/actionbar/overlaying.html</a>..   I have a problem. When I enable the action bar overlay mode,a textView object I create during runtime is covered by the action bar. </p>
  
  <pre><code>   TextView textView =TextView(this);
     textView.setText(message);//message is given from previous activity
     setContentView(textView);
  </code></pre>
  
  <p>Is there anyway to fix this? I was thinking getting the height of the action bar and set the margin but I couldn't find a way to get the height programmatically</p>
  
  <p>here is the layout</p>
  
  <pre><code>  &lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_paddingTop="?attr/actionBarSize"
  tools:context="com.example.galaxy.test.DisplayMessageActivity"
  &gt;
  </code></pre>
  
  <p>and the style.xml
        </p>
  
  <pre><code>&lt;!-- Base application theme. --&gt;
  &lt;style name="AppTheme" parent="Theme.AppCompat" &gt;
  
          &lt;item name="android:windowActionBarOverlay"&gt;true&lt;/item&gt;
  
          &lt;!-- Support library compatibility --&gt;
          &lt;item name="windowActionBarOverlay"&gt;true&lt;/item&gt;
  
  &lt;/style&gt;
  </code></pre>
  
  <p></p>