Note that there are some explanatory texts on larger screens.

plurals
  1. POgetting an illegalStateException for listview
    primarykey
    data
    text
    <p>i have a table layout where i am displaying some data from the database. i have kept the row of the table layout as clickable as i want to show all the details from the database related to that row in a list view after the user clicks that row. after clicking m getting an <strong>IllegalStateException</strong>...</p> <pre><code>04-30 11:17:03.982: E/AndroidRuntime(9466): java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:386) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.widget.AbsListView.obtainView(AbsListView.java:2159) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.widget.ListView.measureHeightOfChildren(ListView.java:1246) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.widget.ListView.onMeasure(ListView.java:1158) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.view.View.measure(View.java:15513) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4827) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) 04-30 11:17:03.982: E/AndroidRuntime(9466): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) </code></pre> <p>anybody has any idea what the problem is?? please help!</p> <p>the listview code:</p> <pre><code>settings = getSharedPreferences("LandTshare", MODE_PRIVATE); prefEditor = settings.edit(); rowid=settings.getInt("rowid", 0); WayDataBase way=new WayDataBase(getApplicationContext()); ArrayList&lt;String&gt; listvalues=way.getListDetails(rowid); if(listvalues.size()!=0) { ListView lv=getListView(); ListAdapter adapter=new ArrayAdapter&lt;String&gt;(ListViewDetails.this, R.layout.view_animal_entry,listvalues); lv.setAdapter(adapter); } </code></pre> <p>view_animal_entry.xml</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:orientation="vertical" &gt; &lt;TextView android:id="@+id/animalId" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone" /&gt; &lt;TextView android:id="@+id/animalName" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginTop="5dp" android:paddingLeft="6dip" android:paddingTop="6dip" android:textColor="#A4C739" android:textSize="17sp" android:textStyle="bold" /&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.
 

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