I dont know why this is happening but no table is created on my Redmi Note 7s when I execute the code but its working fine on GIONEE smartphone and also on virtual devices. I tried changing database version also but no output.
package com.example.attendance;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
public class Databases extends SQLiteOpenHelper {
public static final String dbname = "AttendanceDb11";
public Databases(@Nullable Context context) {
super(context, dbname, null, 5);
}
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS Student12 ( _id INTEGER PRIMARY KEY
AUTOINCREMENT, Name Text)";
db.execSQL(CREATE_TABLE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("Drop table if exists Student12");
onCreate(db);
}
}