The "from" and "to" arrays need to have equal size, and contain values (column names and view ids) that are used for mapping data to UI elements.

Your code seems to try and map a number of data column items into one text view.

The fix is to add more elements to the item layout, and specify themin the "to" array, so each column in the "from" array is mapped to a view.

To display two (or more) tables, you use something called a "table join". It's a standard SQL construct, Google for it.

Finally, use logcat (in Eclipse or "adb logcat" on the host computer) to see more detailed information whenever your application crashes.

Including the Java stack trace from logcat output with your questions is also useful, as it helps others understand what goes on in your application.

-- Kostya

01.09.2010 20:26, kingh32 пишет:
          // Set the list adapter
          String[]from = {DBHelper.COL_ENTRYID,
DBHelper.COL_EVENTNAME,
                         DBHelper.COL_DATE, DBHelper.COL_EVENTTYPE,
DBHelper.COL_NUMROUNDS,
                                DBHelper.COL_PLAYSSPERROUND, 
DBHelper.COL_PLAYERS,
DBHelper.COL_DISTANCE,
                                        DBHelper.COL_TOTALSCORE};

          int[]to = {R.id.the name of my textview};

         // Put retrieved data into a list view
         SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1, cursor, from, to);


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
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