这个问题困扰了我一段时间,因为最近一直困扰我的小问题
1:
public class MySqliteOpenHelper extends SQLiteOpenHelper {public static final String CREATE_TABLE_STUDENT = "CREATE TABLE " + DB_TABLE_STUDENT + " ( text "+ DB_TABLE_STUDENT_NAME + " )";
相当于 create table student ( text name )
2: 我插入的时候:
ContentValues contentValues = new ContentValues();contentValues.put(DB_TABLE_STUDENT_NAME,"hello" + MySqliteOpenHelper.num++);
3: 然后在我自定义的ContentProvider
long insert = writableDatabase.insert(MySqliteOpenHelper.DB_TABLE_STUDENT, null, values);
4: 最后报错: 这个问题最后我发现有报错
2019-05-22 21:47:32.968 5180-5180/bjpkten.contentprovider