Hello,
I have done several tutorials and tried to read everything carefully,
but I still can't fix my problem.
I have a simple database that works. I can read from the database
successfully by printing some rows to the catlog:
Cursor NumbersCursor = db.getNumbers();
startManagingCursor(NumbersCursor);
Log.d("ColCount ",new Integer(NumbersCursor.getColumnCount()).toString
());
Log.d("Columns ", arrayToString(NumbersCursor.getColumnNames(),","));
while(NumbersCursor.moveToNext()) {
Log.d("---------------","---------------");
Log.d("CursorPosition ",new Integer(NumbersCursor.getPosition
()).toString());
Log.d("title",NumbersCursor.getString(1));
Log.d("number",NumbersCursor.getString(2));
Log.d("---------------","---------------");
}
NumbersCursor.moveToPosition(-1);
Now since this works I want to show the data also on the device:
String[] from = new String[]{"title"};
int[] to = new int[]{android.R.id.text1};
ListAdapter adapter =
new SimpleCursorAdapter(
this,
android.R.layout.simple_list_item_1,
NumbersCursor,
from,
to);
setListAdapter(adapter);
But I always receive the "no data" screen on the device.
Does anyone know what I did wrong ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---