The “First” image shows a dialog created using an XML layout that seems to function OK.
If the tablet goes into “hibernate”, after the tablet is activated again the screen image then looks like the “Second” image.
Why does the layout change when entering/leaving hibernation.
The layout file is :
<TableRow android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp" >
<TextView android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginRight="10dp"
android:text="Concept"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:background="@drawable/rectanglewhite"
android:textColor="#000000"
android:gravity="right"/>
<TextView
android:id="@+id/tvsctconcept" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="11"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium"/>
</TableRow>
<TableRow android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp" >
<TextView android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="PT"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:background="@drawable/rectanglepurple"
android:textColor="#000000"
android:gravity="right"/>
<TextView
android:id="@+id/tvsctpt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_weight="11"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</TableRow>
<TableRow android:id="@+id/tableRow4"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp" >
<TextView android:id="@+id/textView3"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="FSN"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:background="@drawable/rectanglebg2"
android:textColor="#000000"
android:gravity="right" />
<TextView
android:id="@+id/tvsctfsn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_weight="11"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</TableRow>
</TableLayout>


You’re using
wrap_contenton the views width. when the xml is first rendered, it’s not measuring against any content. After waking up there are values in thosetextviews, and so they are wrapped to that content. You should set the width to a specific value ormatch_parent.