开发者

Android SQLite returns -1

I'm new here, and I'm working on my first android applicatio开发者_运维知识库n for class. Every time I use mDb.insert(), I get "-1" returned.

In brief, I have:

private SQLiteDatabase mDb;
ContentValues intialValues; //I then .put() some stuff into intialValues 
return mDb.insert("mytable", null, initialValues);

And I get -1.


Use insertOrThrow to get better debugging information. My psychic debugging powers say that you did not properly instantiate mDb using the writable method on the database open helper.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜