I am trying to resolve the Android error "You must specify the layout_height attribute". In the DDMS error message:
10-06 12:45:12.431: WARN/WindowManager(62): HistoryRecord{406287f8 com.learning.android.yamba/.TimelineActivity} failed creating starting window 10-06 12:45:12.431: WARN/WindowManager(62): java.lang.RuntimeException: Binary XML file line
My TimelineActivity XML file is as follows:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" style="@style/activity"> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/title" android:text="@string/titleTimeline" android:layout_gravity="center"> </TextView> <ListView style="@style/editbox" android:id="@+id/listStatuses" android:cacheColorHint="#00000000"> </ListView> </LinearLayout>
Related styles are as follows:
<style name="activity"> <item name="android:orientation">vertical</item> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">fill_parent</item> <item name="android:background">@drawable/background</item> </style> <style name="title"> <item name="android:textSize">25dp</item> <item name="android:gravity">center</item> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> </style> <style name="editbox"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">fill_parent</item> <item name="android:layout_weight">1</item> <item name="android:background">#609f</item> <item name="android:padding">10dp</item> <item name="android:layout_margin">15dp</item> <item name="android:textSize">15dp</item> </style>
The background of the window does not appear in the list window, although I set the transparency of the background of the list. Not sure if the two are related.
source share