I have this method
public ArrayList<Estadisticas> getStats(int p_id) {
String[] columnas = new String[]{"_id", "user_id", "letra", "jugadas", "errores", "acertada", "tiempo"};
Cursor cursor = this.getReadableDatabase().query("estadisticas", columnas, "user_id" + "= " + p_id, null, null, null, null);
ArrayList<Estadisticas> al = new ArrayList<Estadisticas>();
if (cursor != null) {
cursor.moveToFirst();
}
while (!cursor.isAfterLast()) {
Estadisticas stats = new Estadisticas(Integer.parseInt(cursor.getString(0)), Integer.parseInt(cursor.getString(1)),
cursor.getString(2), Integer.parseInt(cursor.getString(3)), Integer.parseInt(cursor.getString(4)), Boolean.parseBoolean(cursor.getString(5)),
cursor.getString(6));
al.add(stats);
cursor.moveToNext();
}
return al;
}
What happens to me is that it does not get into the while. So I do not fill in the ArrayList. Would anyone know the solution?