Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid ListView populeted from SQLite, highlithing not working properly, when selecting an element from list
    primarykey
    data
    text
    <p>I am kind of new to Android, I started working with SQLite 3 days ago. I managed to populate a list from database and defined some views following The Pragmatic Programmers - Hello Android, but I have a problem: when the list is displayed and I want to select an item it only highlights a line below and above the entry in the list. I am sure it has to do something with the definition of the lists row xml or listview xml. Though I will post the entire code.</p> <p>validations_list.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="fill_parent"&gt; &lt;TextView android:id="@+id/l_id" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/l_idcolon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=": " /&gt; &lt;TextView android:id="@+id/l_name" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/L_namecolon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=": " /&gt; &lt;TextView android:id="@+id/av" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ellipsize="end" android:singleLine="true" android:textStyle="italic" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>testing.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="fill_parent" &gt; &lt;!-- Note built-in ids for 'list' and 'empty' --&gt; &lt;ListView android:id="@android:id/list" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/empty" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>And here is the code for my activity: </p> <pre><code>public class LinesListActivity extends ListActivity { private static final String TAG = "ValidationsListActivity"; private static int [] TO = {R.id.l_id,R.id.l_name,R.id.av}; private DbManipulator dbm; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.testing); dbm = new DbManipulator(this); try { Cursor c = dbm.getLines(); startManagingCursor(c); showEvents(c); } finally { } } private void showEvents(Cursor c) { SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.validations_list,c,FROM_V,TO); setListAdapter(adapter); } @Override public void onPause() { super.onPause(); dbm.close(); } } </code></pre> <p>And I have a style defined for my app, but when I change it back to normal style the problem stays, nothing actually changes.</p>
    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.
 

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