hello all ,

here is an issue that drives me crazy :

I have a simple class that extends list activity , for each contact i
have in my phone
it adds a line to the list containing two checkboxes .
It seems to work  but when you check for example the first checkbox ,
and then you scroll the list down
, some other contacts will be checked too like they are linked the one
to the others.
I simplified the code to the extrem minimum and i still have the same
bug . here is the code , if someone know how to deal with that it
would be really nice i spend half the day to try to find a solution to
that .

Thanks a lot

Maaks


[code]


public class CtsList extends ListActivity
{
        public void onCreate(Bundle icicle)
        {
                super.onCreate(icicle);
                Cursor C = getContentResolver().query
(People.CONTENT_URI, null,  "People.NAME!=''", null,"People.NAME");
                startManagingCursor(C);
                String[] columns = new String[] {People.NAME};
                int[] names = new int[] {R.id.row_entry};
                SimpleCursorAdapter mAdapter = new SimpleCursorAdapter
(this, R.layout.contactlist, C, columns, names);
                setListAdapter(mAdapter);
        }
}
[/code]


and the XML file that represent each row :

file name is row_entry.xml

[code]
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android";
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="40px"
android:gravity="left">

                <TextView
                android:id="@+id/row_entry"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:maxLines="1"
                android:maxLength="20"
                android:textSize="9pt"/>

                <LinearLayout
                xmlns:android="http://schemas.android.com/apk/res/android";
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:gravity="right">

                                <CheckBox
                                android:id="@+id/chkbxSMS"
                                android:layout_width="wrap_content"
                                android:layout_height="fill_parent"
                                android:layout_marginRight="5px"
                                />

                                <CheckBox
                                android:id="@+id/chkbxEMAIL"
                                android:layout_width="wrap_content"
                                android:layout_height="fill_parent"
                                />

                </LinearLayout>
</LinearLayout>
[/code]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to