所以我看到并阅读了所有相同的问题,试图解决问题,但我没有找到正确的答案.我试图修改VERSION NUMBER,运行应用程序,但我有错误.之后我从手机中删除了应用程序,将VERSION NUMBER更改为1,再次运行应用程序...同样的错误.
这是我的代码:
MySQLite sql;
Context context;
public MySQLiteAdapter(Context context) { //constructor
sql = new MySQLite(context);
this.context=context;
}
public long insertUser(String Username,String Pass, String Name, String Mail){
SQLiteDatabase db=sql.getWritableDatabase();
ContentValues cv=new ContentValues();
cv.put(MySQLite.COLUMN_USERNAME,Username);
cv.put(MySQLite.COLUMN_PASSWORD,Pass);
cv.put(MySQLite.COLUMN_REALNAME,Name);
cv.put(MySQLite.COLUMN_MAIL,Mail);
long id=db.insert(MySQLite.TABLE_USERS,null,cv);
return id;
}
class MySQLite extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "APPLICATION"; //name database
private static final int DATABASE_VERSION = 1;
public static final String TABLE_USERS="users_table";
public static final String COLUMN_ID = "_id";
public static final String COLUMN_USERNAME="USERNAME"; …Run Code Online (Sandbox Code Playgroud)