Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: i am trying to add a view into a list
    primarykey
    data
    text
    <p>i have made this xml layout file :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/gray" android:orientation="vertical" &gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_margin="10dp" android:background="@color/black" android:layout_height="wrap_content" &gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/s_hour" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/gray" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;TextView android:id="@+id/e_hour" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/gray" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>and i have this line of codes:</p> <pre><code>class WorkingView extends LinearLayout { public WorkingView(Context context,String str) { super(context); // TODO Auto-generated constructor stub setContentView(R.layout.work_data); Text s_hour = (Text) findViewById(R.id.s_hour); s_hour.setData(str); } } </code></pre> <p>and this line from another main class which extends activity:</p> <pre><code>private void readData() { WorkingView wv = new WorkingView(this,"hello"); list.addView(wv); } </code></pre> <p>it all works fine, until the code calls this readData() method.</p> <p>i don't understand what is wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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