Note that there are some explanatory texts on larger screens.

plurals
  1. POlistview checkbox trouble in android
    primarykey
    data
    text
    <p>i have a trouble with listview. i added a checkbox into listview to choose items. my data is coming from sqlite so i use simple cursor adapter. length of my list is aproximatley 250 lines. i am clicking a check box.when i scroll down page (list), checkbox is clicked in every 10 lines.(for example in my screen show 10 lines data when i scroll 11th lines, this row's checkbox had clicked. how can i solve this problem.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;CheckBox android:id="@+id/checkBox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" /&gt; &lt;TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@+id/checkBox" android:textStyle="bold" android:text="TextView" /&gt; &lt;TextView android:id="@+id/nick" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/nick" android:layout_alignBottom="@+id/nick" android:layout_alignParentRight="true" android:text="TextView" /&gt; &lt;TextView android:id="@+id/phone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/name" android:layout_toRightOf="@+id/checkBox" android:text="TextView" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>and this is source code package com.example.myprojects;</p> <pre><code>import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.support.v4.widget.SimpleCursorAdapter; import android.text.Editable; import android.text.TextWatcher; import android.widget.EditText; import android.widget.ListView; public class send_message extends Activity { private ListView list; private EditText search; SimpleCursorAdapter adapterx; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_sendmessage); list=(ListView)findViewById(R.id.list); search=(EditText)findViewById(R.id.search); loadfromdatabase(); } private void loadfromdatabase() { mydb info=new mydb(this); info.open_read(); Cursor c = info.getAllData(); String[] columns = new String[] {mydb.KEY_NAME,mydb.KEY_PHONE, mydb.KEY_NICK}; int[] to = new int[] {R.id.name,R.id.phone, R.id.nick }; @SuppressWarnings("deprecation") SimpleCursorAdapter adapter= new SimpleCursorAdapter(this, R.layout.activity_sendmesage_rows, c, columns, to,0); list.setAdapter(adapter); info.close(); } } </code></pre>
    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