The application was working well, but became closed on some devices and this code for the application
my code is:
public List<item> getListProduct() {
item product = null;
List<item> productList = new ArrayList<>();
openDatabase();
Cursor cursor = mDatabase.rawQuery("SELECT * FROM tablo", null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
product = new item(cursor.getInt(0),
cursor.getString(1),
cursor.getString(2),
cursor.getString(3),
cursor.getString(4),
cursor.getString(5),
cursor.getInt(6));
productList.add(product);
cursor.moveToNext();
}
cursor.close();
closeDatabase();
return productList;
}
i get this error
Caused by: android.database.sqlite.SQLiteException
any helpe