Q:

Can´t select first row in table

I have table subject, when I try the query in adb shell the output is OK
SELECT * FROM subject;
The output is 10 rows...
When I do the same in Java/Android:
public ArrayList<Subject> getSubjectList() {
    SQLiteDatabase db = DatabaseManager.getInstance().openDatabase();

    ArrayList<Subject> subjects = new ArrayList<Subject>();
    String selectQuery = "SELECT * FROM subject";
    Cursor cursor = db.rawQuery(selectQuery, null);

    if (cursor.moveToFirst()) {
        while (cursor.moveToNext()) {
            Subject subject = new Subject();
            subject.setId_subject(Integer.parseInt(cursor.getString(0)));
            subject.setName(cursor.getString(1));
            subjects.add(subject);
        }
    }

    cursor.close();

    DatabaseManager.getInstance().closeDatabase();

    return subjects;
}

The output is 9 rows... the first row with id 1 will not display, why?

A:

Because you move to the next (moveToNext()) row immediately after moving on the first one (moveToFirst())...
What i normally do is something like this:
        if (cursor != null)
        {
            if (cursor.moveToFirst())
            {
                do
                {
                    // ... 
                }
                while (cursor.moveToNext());
            }
        }

