I looked more into the list11.java and the row xml... so i realised
i've got the CheckedTextView within the LinearLayout,
so listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); is working
on the linearLayout and not the checkedTextView.
so i changed the row xml to simply;


<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/
android"
                     android:id="@+id/workout_text"
                     android:layout_width="fill_parent"
                     android:layout_height="?android:attr/
listPreferredItemHeight"
                     android:textAppearance="?android:attr/
textAppearanceMedium"
                     android:gravity="center_vertical"
                     android:checkMark="?android:attr/
listChoiceIndicatorMultiple"
                     android:paddingLeft="6dip"
                     android:paddingRight="6dip"
                 />

which now works great :)

But this leaves me with the same problem i tried to solve by adding a
Text View, because i want the Text of the
CheckedTextView to be "DESCRIPTION - STARTDATE " but the;

SimpleCursorAdapter exercises =
             new SimpleCursorAdapter(this, R.layout.exercise_row,
mExerciseCursor, from, to);

Adds the "DESCRIPTION" only to the checkboxview.

how to change that title?

Cheers,
Simon

On May 22, 1:59 am, Simon <[email protected]> wrote:
> Hello,
> I've got the following row xml file which consists of CheckboxView and
> TextView;
>
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent">
>
>                 <CheckedTextView 
> xmlns:android="http://schemas.android.com/apk/res/
> android"
>                     android:id="@+id/workout_text"
>                     android:layout_width="fill_parent"
>                     
> android:layout_height="?android:attr/listPreferredItemHeight"
>                     
> android:textAppearance="?android:attr/textAppearanceMedium"
>                     android:gravity="center_vertical"
>                     
> android:checkMark="?android:attr/listChoiceIndicatorMultiple"
>                     android:paddingLeft="6dip"
>                     android:paddingRight="6dip"
>                 />
>                 <TextView android:id="@+id/date_text"
>                     xmlns:android="http://schemas.android.com/apk/res/android";
>                     android:textAppearance="?android:attr/textAppearanceSmall"
>                     android:layout_width="wrap_content"
>                     android:layout_height="wrap_content"
>                  />
> </LinearLayout>
>
> Following the notepad and list11.java examples, i have the following
> fillData() function which creates an array adapter and sets
> theListView.CHOICE_MODE_MULTIPLE;
> private void fillData() {
>         // Get all of the exercises from the database and create the
> item list
>         mExerciseCursor = mDbHelper.fetchAllExercise();
>         startManagingCursor(mExerciseCursor);
>
>         String[] from = new String[]
> { ExerciseDbAdapter.KEY_DESCRIPTION ,
> ExerciseDbAdapter.KEY_STARTDATE };
>         int[] to = new int[] { R.id.workout_text, R.id.date_text};
>
>         // Now create an array adapter and set it to display using our
> row
>         SimpleCursorAdapter exercises =
>             new SimpleCursorAdapter(this, R.layout.exercise_row,
> mExerciseCursor, from, to);
>
>         setListAdapter(exercises);
>
>         final ListView listView = getListView();
>         listView.setItemsCanFocus(false);
>         listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
>     }
>
> When the app run, i'm unable to "tick" any of the check boxes... what
> am i doing wrong??
>
> thank you for your help.
--~--~---------~--~----~------------~-------~--~----~
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