0

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

  • Hi, and welcome to StackOverflow. Can you show the entire stacktrace? SQLiteException is very generic. – Tudor May 06 '20 at 08:22
  • :Caused by: android.database.scilite.SQLiteException . at (Native Method:0) . at (SQLiteConnection.java:948) at (SQLiteConnection.java:559) . at (SQLiteSession.java:603) . at (SQLitePrograrn.java:63) . at (SQLiteQuery.java:37) . at (SQLiteDirectCursorDriverjava:46) . at (SQLiteDatabase.java:1493) . at (SQLiteDatabase.java:1427) at (databaseClass.java:60) (at .(windows_asila.java:126 . at (Activity.java:7458) . at (Activity.java:7448) . at (Instrumentation.javal 286) . at (ActivityThreadjava:3409) – android man May 06 '20 at 11:08

0 Answers0