在我的代码的某个地方,我这样做:
contentValues = new ContentValues();
// contentValues.put("_ID",BaseColumns._ID); // Not Working can someone explain what this is and how it's used BaseColumns._ID ?
contentValues.put("_ID", null); // Not working, Everywhere they say to pass in a null value and Android will do it's magic ...
contentValues.put("_ID", "1") // This works but has to be changed manually every time
contentValues.put("login", username.getText().toString());
contentValues.put("password", pwd.getText().toString());
contentValues.put("type", type);
这是我的小架构:
public static final String CREATE_DATABASE = "CREATE TABLE "+
TABLE +"(_ID INTEGER PRIMARY KEY AUTOINCREMENT, login VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, type CHAR(1) NOT NULL)";
有人说不要放AUTOINCREMENT,但是在其他一些网站你可以在代码中看到。我不知道该怎么办了。如何让 Android 选择下一个增量值?