Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a list with each item containing different elements in Android
    primarykey
    data
    text
    <p>I am new to Android development. I have created an Activity with the ListView like interface, but without using ListView as each item(row) in the list might have different elements. I have successfully created it by including LinearLayouts inside the ScrollView, but the XML looks messy. I have also added onClickListener to each of the inner LinearLayouts. </p> <p>Is there a better way of doing this?</p> <p>Thanks.</p> <p>Regards,</p> <p>dezull</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout android:layout_height="fill_parent" android:orientation="vertical" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;ScrollView android:id="@+id/ScrollView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"&gt; &lt;LinearLayout android:id="@+id/LinearLayout02" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"&gt; &lt;LinearLayout android:id="@+id/wo_status_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@color/desc_button" android:focusable="true" android:padding="3dp"&gt; &lt;TextView android:id="@+id/wo_status" android:text="@string/wo_status" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/wo_status" android:text="Waiting for Parts" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/wo_prob_desc_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@color/desc_button" android:focusable="true" android:padding="3dp"&gt; &lt;TextView android:id="@+id/wo_prob_desc" android:text="@string/wo_status" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/wo_prob_desc" android:text="New problem" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload