I have a list, which shows all sqlite bank data, image path, latitude and longitude, but in the list only changes the image path, latitude and longitude always stays the first record.
public List<Foto> todasFotos(){
List<Foto> listaFotos = new ArrayList<Foto>();
SQLiteDatabase db = getReadableDatabase();
String sqlTodasFotos = "SELECT * FROM imagens";
Cursor c = db.rawQuery(sqlTodasFotos,null);
if (c.moveToNext()) {
do {
Foto foto = new Foto();
foto.setId(c.getInt(0));
foto.setCaminho_foto(c.getString(1));
foto.setLatitude(c.getDouble(2));
foto.setLongitude(c.getDouble(3));
listaFotos.add(foto);
} while (c.moveToNext());
}
db.close();
return listaFotos;
}