I am quite new to android programming. As I follow the tutorials here,https://developer.android.com/training/basics/actionbar/overlaying.html.. 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.
TextView textView =TextView(this);
textView.setText(message);//message is given from previous activity
setContentView(textView);
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
here is the layout
<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"
>
and the style.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat" >
<item name="android:windowActionBarOverlay">true</item>
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
</style>