Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 表用户没有名为Course的列_Java_Android_Database_Sqlite_Android Sqlite - Fatal编程技术网

Java 表用户没有名为Course的列

Java 表用户没有名为Course的列,java,android,database,sqlite,android-sqlite,Java,Android,Database,Sqlite,Android Sqlite,DatabaseHandler.Java private static final int DATABASE_Version=4; private static final String DATABASE_Name="UserManager"; private static final String TABLE_USERS="Users"; private SQLiteDatabase db; private static final String USE

DatabaseHandler.Java

    private static final int DATABASE_Version=4;
    private static final String DATABASE_Name="UserManager";
    private static final String TABLE_USERS="Users";
    private SQLiteDatabase db;
    private static final String USER_NAME ="Name";
    private static final String USER_PASSWRD ="Passwrod";
    private static final String USER_REPASSWRD ="ReEnterPassword";
    private static final String USER_EMAIL ="Email";
    private static final String USER_AGE ="Age";
    private static final String USER_PHONENO ="PhoneNumber";
    private static final String USER_COLLEGE ="College";
    private static final String USER_COURSE ="Course";
    public DatabaseHandler(Context context){
        super(context, DATABASE_Name, null, DATABASE_Version);
    }
    public void onCreate(SQLiteDatabase db) {
        String CREATE_USERS_TABLE = "CREATE TABLE " + TABLE_USERS + "("
                + USER_NAME + " TEXT," + USER_PASSWRD + " TEXT,"
                + USER_REPASSWRD + " TEXT," + USER_EMAIL + " TEXT PRIMARY KEY,"  + USER_PHONENO +" INTEGER," + USER_COLLEGE + " TEXT,"
                 + USER_COURSE + " TEXT);" ;
        db.execSQL(CREATE_USERS_TABLE);
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // Drop older table if existed
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_USERS);

        // Create tables again
        onCreate(db);
    }
    public void addUser(signup users) {
        db = this.getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(USER_NAME, users.getName()); // Contact Name
        values.put(USER_PASSWRD, users.getPasswrd());
        values.put(USER_REPASSWRD, users.getRepaswrd());
        values.put(USER_EMAIL, users.getEmail());
        values.put(USER_AGE, users.getAge());
        values.put(USER_PHONENO, users.getPhoneno());
        values.put(USER_COLLEGE, users.getCollege());
        values.put(USER_COURSE, users.getCourse()); // Contact Phone Number
        // Inserting Row
        db.insert(TABLE_USERS, null, values);
        db.close(); // Closing database connection
    }


    public void open()
    {
       db = this.getWritableDatabase();
    }


    public void close()
    {
        this.close();
    }

    public boolean Login(String username, String password) throws SQLException
    {
        db = null;
        Cursor mCursor = db.rawQuery("SELECT * FROM " + TABLE_USERS + " WHERE ``username=? AND password=?", new String[]{username,password});
        if (mCursor != null) {
            if(mCursor.getCount() > 0)
            {
                return true;
            }
        }
        return false;
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        final DatabaseHandler db=new DatabaseHandler(this);

        final TextView name1 = (TextView) findViewById(R.id.name);


        final TextView pwd1 = (TextView) findViewById(R.id.paswrd);
        final TextView cnfrm1 = (TextView) findViewById(R.id.repaswrd);
        final TextView email1 = (TextView) findViewById(R.id.email);
        final TextView age1 = (TextView) findViewById(R.id.age);
        final TextView phone1 = (TextView) findViewById(R.id.phone);
        final TextView college1 = (TextView) findViewById(R.id.college);
        final TextView course1 = (TextView) findViewById(R.id.course);



        Button signup = (Button) findViewById(R.id.button);
        View.OnClickListener sp = new View.OnClickListener()

        {
            @Override
            public void onClick(View v) {

                String name = name1.getText().toString();
                String pwd = pwd1.getText().toString();
                String cnfrm = cnfrm1.getText().toString();
                String email = email1.getText().toString();
                String age = age1.getText().toString();
                String phone = phone1.getText().toString();
                String college = college1.getText().toString();
                String course = course1.getText().toString();

                if (name.isEmpty()) {
                    name1.setError("Enter Name");
                } else if (pwd.isEmpty()) {
                    pwd1.setError("Enter Password");
                } else if (cnfrm.isEmpty()) {
                    cnfrm1.setError("Enter Confirm Password ");
                } else if (email.isEmpty()) {
                    email1.setError("Enter Email");
                } else if (age.isEmpty()) {
                    age1.setError("Enter Age");
                } else if (phone.isEmpty()) {
                    phone1.setError("Enter Phone Number");
                } else if (college.isEmpty()) {
                    college1.setError("Enter College name");
                } else if (course.isEmpty()) {
                    course1.setError("Enter Course");
                } else if (!(pwd.equals(cnfrm))) {
                    cnfrm1.setError("Password doesn't Match");
                } else {

                    String name_1= name1.getText().toString();
                    String pass_1= pwd1.getText().toString();
                    String repass_1= cnfrm1.getText().toString();
                    String email_1= email1.getText().toString();
                    String age_1= age1.getText().toString();
                    String phoneno_1= phone1.getText().toString();
                    String clg_1= college1.getText().toString();
                    String course_1= course1.getText().toString();
                    Log.d("Insert: ", "Inserting ..");
                    db.addUser(new signup(name_1, pass_1, repass_1, email_1, age_1, phoneno_1, clg_1, course_1));

                     Toast.makeText(getApplicationContext(), "Successfully Signed in", Toast.LENGTH_LONG).show();
                    Intent intent=new Intent(RegisterActivity.this,FirstActivity.class);

                    startActivity(intent);
                }
            }
        };

        signup.setOnClickListener(sp);
        Button reset=(Button) findViewById(R.id.rest);
        View.OnClickListener rs= new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ((TextView) findViewById(R.id.name)).setText(null);
                ((TextView) findViewById(R.id.course)).setText(null);
                ((TextView) findViewById(R.id.email)).setText(null);
                ((TextView) findViewById(R.id.age)).setText(null);
                ((TextView) findViewById(R.id.college)).setText(null);
                ((TextView) findViewById(R.id.paswrd)).setText(null);
                ((TextView) findViewById(R.id.repaswrd)).setText(null);
                ((TextView) findViewById(R.id.phone)).setText(null);
            }
        };
        reset.setOnClickListener(rs);
    }
public class signup {
    String name;
    String passwrd;
    String repaswrd;
    String email;
    String age;
    String phoneno;
    String college;
    String course;


    public signup(String name,String passwrd,String repaswrd,String email,String age,String phoneno,String college,String course){
        this.name=name;
        this.passwrd=passwrd;
        this.repaswrd=repaswrd;
        this.email=email;
        this.age=age;
        this.phoneno=phoneno;
        this.college=college;
        this.course=course;

    }

    public signup(String name,String passwrd,String repaswrd,String email,String college,String course){
        this.name=name;
        this.passwrd=passwrd;
        this.repaswrd=repaswrd;
        this.email=email;
        this.college=college;
        this.course=course;

    }


    public String getName(){
        return this.name;
    }
    public String getPasswrd(){
        return this.passwrd;
    }
    public String getRepaswrd(){
        return this.repaswrd;
    }
    public String getEmail(){
        return this.email;
    }
    public String getAge(){
        return this.age;
    }
    public String getPhoneno(){
        return this.phoneno;
    }
    public String getCollege(){
        return this.college;
    }
    public String getCourse(){
        return this.course;
    }
}
RegisterActivity.Java

    private static final int DATABASE_Version=4;
    private static final String DATABASE_Name="UserManager";
    private static final String TABLE_USERS="Users";
    private SQLiteDatabase db;
    private static final String USER_NAME ="Name";
    private static final String USER_PASSWRD ="Passwrod";
    private static final String USER_REPASSWRD ="ReEnterPassword";
    private static final String USER_EMAIL ="Email";
    private static final String USER_AGE ="Age";
    private static final String USER_PHONENO ="PhoneNumber";
    private static final String USER_COLLEGE ="College";
    private static final String USER_COURSE ="Course";
    public DatabaseHandler(Context context){
        super(context, DATABASE_Name, null, DATABASE_Version);
    }
    public void onCreate(SQLiteDatabase db) {
        String CREATE_USERS_TABLE = "CREATE TABLE " + TABLE_USERS + "("
                + USER_NAME + " TEXT," + USER_PASSWRD + " TEXT,"
                + USER_REPASSWRD + " TEXT," + USER_EMAIL + " TEXT PRIMARY KEY,"  + USER_PHONENO +" INTEGER," + USER_COLLEGE + " TEXT,"
                 + USER_COURSE + " TEXT);" ;
        db.execSQL(CREATE_USERS_TABLE);
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // Drop older table if existed
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_USERS);

        // Create tables again
        onCreate(db);
    }
    public void addUser(signup users) {
        db = this.getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(USER_NAME, users.getName()); // Contact Name
        values.put(USER_PASSWRD, users.getPasswrd());
        values.put(USER_REPASSWRD, users.getRepaswrd());
        values.put(USER_EMAIL, users.getEmail());
        values.put(USER_AGE, users.getAge());
        values.put(USER_PHONENO, users.getPhoneno());
        values.put(USER_COLLEGE, users.getCollege());
        values.put(USER_COURSE, users.getCourse()); // Contact Phone Number
        // Inserting Row
        db.insert(TABLE_USERS, null, values);
        db.close(); // Closing database connection
    }


    public void open()
    {
       db = this.getWritableDatabase();
    }


    public void close()
    {
        this.close();
    }

    public boolean Login(String username, String password) throws SQLException
    {
        db = null;
        Cursor mCursor = db.rawQuery("SELECT * FROM " + TABLE_USERS + " WHERE ``username=? AND password=?", new String[]{username,password});
        if (mCursor != null) {
            if(mCursor.getCount() > 0)
            {
                return true;
            }
        }
        return false;
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        final DatabaseHandler db=new DatabaseHandler(this);

        final TextView name1 = (TextView) findViewById(R.id.name);


        final TextView pwd1 = (TextView) findViewById(R.id.paswrd);
        final TextView cnfrm1 = (TextView) findViewById(R.id.repaswrd);
        final TextView email1 = (TextView) findViewById(R.id.email);
        final TextView age1 = (TextView) findViewById(R.id.age);
        final TextView phone1 = (TextView) findViewById(R.id.phone);
        final TextView college1 = (TextView) findViewById(R.id.college);
        final TextView course1 = (TextView) findViewById(R.id.course);



        Button signup = (Button) findViewById(R.id.button);
        View.OnClickListener sp = new View.OnClickListener()

        {
            @Override
            public void onClick(View v) {

                String name = name1.getText().toString();
                String pwd = pwd1.getText().toString();
                String cnfrm = cnfrm1.getText().toString();
                String email = email1.getText().toString();
                String age = age1.getText().toString();
                String phone = phone1.getText().toString();
                String college = college1.getText().toString();
                String course = course1.getText().toString();

                if (name.isEmpty()) {
                    name1.setError("Enter Name");
                } else if (pwd.isEmpty()) {
                    pwd1.setError("Enter Password");
                } else if (cnfrm.isEmpty()) {
                    cnfrm1.setError("Enter Confirm Password ");
                } else if (email.isEmpty()) {
                    email1.setError("Enter Email");
                } else if (age.isEmpty()) {
                    age1.setError("Enter Age");
                } else if (phone.isEmpty()) {
                    phone1.setError("Enter Phone Number");
                } else if (college.isEmpty()) {
                    college1.setError("Enter College name");
                } else if (course.isEmpty()) {
                    course1.setError("Enter Course");
                } else if (!(pwd.equals(cnfrm))) {
                    cnfrm1.setError("Password doesn't Match");
                } else {

                    String name_1= name1.getText().toString();
                    String pass_1= pwd1.getText().toString();
                    String repass_1= cnfrm1.getText().toString();
                    String email_1= email1.getText().toString();
                    String age_1= age1.getText().toString();
                    String phoneno_1= phone1.getText().toString();
                    String clg_1= college1.getText().toString();
                    String course_1= course1.getText().toString();
                    Log.d("Insert: ", "Inserting ..");
                    db.addUser(new signup(name_1, pass_1, repass_1, email_1, age_1, phoneno_1, clg_1, course_1));

                     Toast.makeText(getApplicationContext(), "Successfully Signed in", Toast.LENGTH_LONG).show();
                    Intent intent=new Intent(RegisterActivity.this,FirstActivity.class);

                    startActivity(intent);
                }
            }
        };

        signup.setOnClickListener(sp);
        Button reset=(Button) findViewById(R.id.rest);
        View.OnClickListener rs= new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ((TextView) findViewById(R.id.name)).setText(null);
                ((TextView) findViewById(R.id.course)).setText(null);
                ((TextView) findViewById(R.id.email)).setText(null);
                ((TextView) findViewById(R.id.age)).setText(null);
                ((TextView) findViewById(R.id.college)).setText(null);
                ((TextView) findViewById(R.id.paswrd)).setText(null);
                ((TextView) findViewById(R.id.repaswrd)).setText(null);
                ((TextView) findViewById(R.id.phone)).setText(null);
            }
        };
        reset.setOnClickListener(rs);
    }
public class signup {
    String name;
    String passwrd;
    String repaswrd;
    String email;
    String age;
    String phoneno;
    String college;
    String course;


    public signup(String name,String passwrd,String repaswrd,String email,String age,String phoneno,String college,String course){
        this.name=name;
        this.passwrd=passwrd;
        this.repaswrd=repaswrd;
        this.email=email;
        this.age=age;
        this.phoneno=phoneno;
        this.college=college;
        this.course=course;

    }

    public signup(String name,String passwrd,String repaswrd,String email,String college,String course){
        this.name=name;
        this.passwrd=passwrd;
        this.repaswrd=repaswrd;
        this.email=email;
        this.college=college;
        this.course=course;

    }


    public String getName(){
        return this.name;
    }
    public String getPasswrd(){
        return this.passwrd;
    }
    public String getRepaswrd(){
        return this.repaswrd;
    }
    public String getEmail(){
        return this.email;
    }
    public String getAge(){
        return this.age;
    }
    public String getPhoneno(){
        return this.phoneno;
    }
    public String getCollege(){
        return this.college;
    }
    public String getCourse(){
        return this.course;
    }
}
signup.Java

    private static final int DATABASE_Version=4;
    private static final String DATABASE_Name="UserManager";
    private static final String TABLE_USERS="Users";
    private SQLiteDatabase db;
    private static final String USER_NAME ="Name";
    private static final String USER_PASSWRD ="Passwrod";
    private static final String USER_REPASSWRD ="ReEnterPassword";
    private static final String USER_EMAIL ="Email";
    private static final String USER_AGE ="Age";
    private static final String USER_PHONENO ="PhoneNumber";
    private static final String USER_COLLEGE ="College";
    private static final String USER_COURSE ="Course";
    public DatabaseHandler(Context context){
        super(context, DATABASE_Name, null, DATABASE_Version);
    }
    public void onCreate(SQLiteDatabase db) {
        String CREATE_USERS_TABLE = "CREATE TABLE " + TABLE_USERS + "("
                + USER_NAME + " TEXT," + USER_PASSWRD + " TEXT,"
                + USER_REPASSWRD + " TEXT," + USER_EMAIL + " TEXT PRIMARY KEY,"  + USER_PHONENO +" INTEGER," + USER_COLLEGE + " TEXT,"
                 + USER_COURSE + " TEXT);" ;
        db.execSQL(CREATE_USERS_TABLE);
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // Drop older table if existed
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_USERS);

        // Create tables again
        onCreate(db);
    }
    public void addUser(signup users) {
        db = this.getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(USER_NAME, users.getName()); // Contact Name
        values.put(USER_PASSWRD, users.getPasswrd());
        values.put(USER_REPASSWRD, users.getRepaswrd());
        values.put(USER_EMAIL, users.getEmail());
        values.put(USER_AGE, users.getAge());
        values.put(USER_PHONENO, users.getPhoneno());
        values.put(USER_COLLEGE, users.getCollege());
        values.put(USER_COURSE, users.getCourse()); // Contact Phone Number
        // Inserting Row
        db.insert(TABLE_USERS, null, values);
        db.close(); // Closing database connection
    }


    public void open()
    {
       db = this.getWritableDatabase();
    }


    public void close()
    {
        this.close();
    }

    public boolean Login(String username, String password) throws SQLException
    {
        db = null;
        Cursor mCursor = db.rawQuery("SELECT * FROM " + TABLE_USERS + " WHERE ``username=? AND password=?", new String[]{username,password});
        if (mCursor != null) {
            if(mCursor.getCount() > 0)
            {
                return true;
            }
        }
        return false;
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        final DatabaseHandler db=new DatabaseHandler(this);

        final TextView name1 = (TextView) findViewById(R.id.name);


        final TextView pwd1 = (TextView) findViewById(R.id.paswrd);
        final TextView cnfrm1 = (TextView) findViewById(R.id.repaswrd);
        final TextView email1 = (TextView) findViewById(R.id.email);
        final TextView age1 = (TextView) findViewById(R.id.age);
        final TextView phone1 = (TextView) findViewById(R.id.phone);
        final TextView college1 = (TextView) findViewById(R.id.college);
        final TextView course1 = (TextView) findViewById(R.id.course);



        Button signup = (Button) findViewById(R.id.button);
        View.OnClickListener sp = new View.OnClickListener()

        {
            @Override
            public void onClick(View v) {

                String name = name1.getText().toString();
                String pwd = pwd1.getText().toString();
                String cnfrm = cnfrm1.getText().toString();
                String email = email1.getText().toString();
                String age = age1.getText().toString();
                String phone = phone1.getText().toString();
                String college = college1.getText().toString();
                String course = course1.getText().toString();

                if (name.isEmpty()) {
                    name1.setError("Enter Name");
                } else if (pwd.isEmpty()) {
                    pwd1.setError("Enter Password");
                } else if (cnfrm.isEmpty()) {
                    cnfrm1.setError("Enter Confirm Password ");
                } else if (email.isEmpty()) {
                    email1.setError("Enter Email");
                } else if (age.isEmpty()) {
                    age1.setError("Enter Age");
                } else if (phone.isEmpty()) {
                    phone1.setError("Enter Phone Number");
                } else if (college.isEmpty()) {
                    college1.setError("Enter College name");
                } else if (course.isEmpty()) {
                    course1.setError("Enter Course");
                } else if (!(pwd.equals(cnfrm))) {
                    cnfrm1.setError("Password doesn't Match");
                } else {

                    String name_1= name1.getText().toString();
                    String pass_1= pwd1.getText().toString();
                    String repass_1= cnfrm1.getText().toString();
                    String email_1= email1.getText().toString();
                    String age_1= age1.getText().toString();
                    String phoneno_1= phone1.getText().toString();
                    String clg_1= college1.getText().toString();
                    String course_1= course1.getText().toString();
                    Log.d("Insert: ", "Inserting ..");
                    db.addUser(new signup(name_1, pass_1, repass_1, email_1, age_1, phoneno_1, clg_1, course_1));

                     Toast.makeText(getApplicationContext(), "Successfully Signed in", Toast.LENGTH_LONG).show();
                    Intent intent=new Intent(RegisterActivity.this,FirstActivity.class);

                    startActivity(intent);
                }
            }
        };

        signup.setOnClickListener(sp);
        Button reset=(Button) findViewById(R.id.rest);
        View.OnClickListener rs= new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ((TextView) findViewById(R.id.name)).setText(null);
                ((TextView) findViewById(R.id.course)).setText(null);
                ((TextView) findViewById(R.id.email)).setText(null);
                ((TextView) findViewById(R.id.age)).setText(null);
                ((TextView) findViewById(R.id.college)).setText(null);
                ((TextView) findViewById(R.id.paswrd)).setText(null);
                ((TextView) findViewById(R.id.repaswrd)).setText(null);
                ((TextView) findViewById(R.id.phone)).setText(null);
            }
        };
        reset.setOnClickListener(rs);
    }
public class signup {
    String name;
    String passwrd;
    String repaswrd;
    String email;
    String age;
    String phoneno;
    String college;
    String course;


    public signup(String name,String passwrd,String repaswrd,String email,String age,String phoneno,String college,String course){
        this.name=name;
        this.passwrd=passwrd;
        this.repaswrd=repaswrd;
        this.email=email;
        this.age=age;
        this.phoneno=phoneno;
        this.college=college;
        this.course=course;

    }

    public signup(String name,String passwrd,String repaswrd,String email,String college,String course){
        this.name=name;
        this.passwrd=passwrd;
        this.repaswrd=repaswrd;
        this.email=email;
        this.college=college;
        this.course=course;

    }


    public String getName(){
        return this.name;
    }
    public String getPasswrd(){
        return this.passwrd;
    }
    public String getRepaswrd(){
        return this.repaswrd;
    }
    public String getEmail(){
        return this.email;
    }
    public String getAge(){
        return this.age;
    }
    public String getPhoneno(){
        return this.phoneno;
    }
    public String getCollege(){
        return this.college;
    }
    public String getCourse(){
        return this.course;
    }
}
错误:

E/SQLiteLog:(1)表用户没有名为Course的列 01-25 22:45:31.414 12064-12064/com.pixel.sri.justdoit E/SQLiteDatabase:插入课程时出错=B.E重新输入密码=sri Passwrod=sri Email=sriram。mdu31@gmail.com学院=亚太经合组织 电话号码=7402043073年龄=21姓名=sriram android.database.sqlite.SQLiteException:表用户没有列 命名课程(代码1):,编译时:插入 用户(课程、重新输入密码、密码、电子邮件、大学、电话号码、年龄、姓名) 值(?,,,,,,,,,,,,?) 在 android.database.sqlite.SQLiteConnection.nativePrepareStatement(本机 (方法) 在 android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887) 在 android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498) 在 android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588) 位于android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:58) 在 android.database.sqlite.SQLiteStatement.(SQLiteStatement.java:31) 在 android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1469) 在 android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1341) 在 com.pixel.sri.justdoit.DatabaseHandler.addUser(DatabaseHandler.java:66) 在 RegisterActivity$1.onClick(RegisterActivity.java:81) 在android.view.view.performClick上(view.java:5201) 在android.view.view$PerformClick.run(view.java:21163) 位于android.os.Handler.handleCallback(Handler.java:746) 位于android.os.Handler.dispatchMessage(Handler.java:95) 位于android.os.Looper.loop(Looper.java:148) 位于android.app.ActivityThread.main(ActivityThread.java:5443) 位于java.lang.reflect.Method.invoke(本机方法) 在 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) 位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 01-25 22:45:31.572 12064-12089/com.pixel.sri.justdoit V/RenderScript:0xb8b446f0启动线程,CPU 8


您可能在上一次运行之后添加了该列,当时数据库已经创建

解决方案:卸载并重新安装应用程序。

替代解决方案:增加数据库版本常量值。

如果
课程
列是最近添加到数据库中的,但您忘记增加数据库版本,则这种情况很常见

使用您拥有的代码,颠簸您的数据库版本将擦除数据库,并使用正确的列重新创建数据库


或者,卸载并重新安装你的应用程序可以修复它。

你是否升级了数据库版本;在这里,您可以找到一个关于在android中使用SQLite数据库的优秀教程。