[android-developers] Re: Probelm with getting posts from database

2011-02-10 Thread André
My misstake! I didn't remove cursor.moveToFirst(); So that must have been the problem all the time. It does return -1. After move to first its 0. Works fine now! //André On Feb 10, 1:22 pm, Kostya Vasilyev wrote: > Interesting. > > The docs specifically say that query() returns "A Cursor objec

Re: [android-developers] Re: Probelm with getting posts from database

2011-02-10 Thread Kostya Vasilyev
Interesting. The docs specifically say that query() returns "A Cursor object, which is positioned before the first entry." You can test by calling cursor.getPosition(), it should be "-1". Are you moving the cursor *before* that processing loop? (calling any move() methods?) If you're not,

[android-developers] Re: Probelm with getting posts from database

2011-02-10 Thread André
Thanks Kostya, I did as you suggested and it looks much better. For my question though I got the same problem when using your code. But I tried adding: String item1 = cursor.getString(index1); String item2 = cursor.getString(index2); before while(cursor.moveToNext()){ as well as in it. And then i