I have a layout that throws this error during layout previews : Index 0 Size 0
ONLY in very large screen sizes. Also another error that I see is
Broken rendering library , unsupported library. try using the SDK manager to get updated layout libraries
.
No such library was required for that particular layout.
Other layouts work fine in the layout-large qualifier.
The whole code is beneath : I gave the whole code because I have no idea which part is causing the problem.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#B35555" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eeeeee"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="#00B16A"
android:orientation="horizontal" >
<TextView
android:id="@+id/form"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/form"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:textSize="17sp" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/home" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/layout_chap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_margin="15dp"
android:layout_below="@+id/chap_heading"
android:background="@drawable/rounded">
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp" >
<LinearLayout
android:id="@+id/chaps"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
</RelativeLayout>
<LinearLayout
android:id="@+id/layout_others"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:background="@drawable/rounded"
android:orientation="vertical"
android:layout_marginBottom="15dp"
android:layout_below="@+id/others">
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp" >
<LinearLayout
android:id="@+id/others_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
</LinearLayout>
</ScrollView>
</LinearLayout>
<TextView
android:id="@+id/chap_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/layout_chap"
android:layout_alignParentTop="true"
android:text=" Chapterwise Formulae"
android:layout_marginTop="20dp"
/>
<TextView
android:id="@+id/others"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/layout_others"
android:layout_marginTop="20dp"
android:layout_below="@+id/layout_chap"
android:text="@string/others_text" /> >
</RelativeLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#00B16A"
android:orientation="horizontal" >
<Button
android:id="@+id/phyid"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="bottom|center_vertical"
android:layout_toLeftOf="@+id/chemid"
android:layout_weight="1"
android:background="@drawable/button_form_phy"
android:textColor="#ffffff" />
<Button
android:id="@+id/chemid"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/button_form_chem"
android:textColor="#ffffff" />
<Button
android:id="@+id/mathid"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/chemid"
android:layout_weight="1"
android:background="@drawable/button_form_math"
android:textColor="#ffffff" />
</LinearLayout>
The last linear layout here contains buttons which are 9patch images. I read somewhere that it can cause such errors. Dont know why.