[android-developers] Probelm with getting posts from database

2011-02-10 Thread André
I have a listview that gets it's posts from a database. I want the ten latest entries sorted by the time they where added to the database. This works, but it always skips the first post until a newer one is added. What could I be doing wrong? For this I use the following code: public Cursor

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

2011-02-10 Thread Kostya Vasilyev
This for loop looks really strange: for(cursor.moveToFirst(); cursor.moveToNext(); cursor.isAfterLast()) The condition for isAfterLast should be inverted. Also don't iterate twice and call getColumnIndex for each row, nether of those is necessary. Something like this should work: cursor =