且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将数据插入到sqlite数据库中时出错

更新时间:2022-04-23 02:39:33

很难知道代码中的行号是否匹配traceback,但我猜测(EditText)findViewById(R.id.title)返回null。在执行插入操作时,在hierarchyviewer中检查应用程序,并确保在您处理插入代码时,您认为在层次结构中存在的视图实际上存在。

It's hard to tell without line numbers in your code to match the traceback but I'm guessing that (EditText) findViewById(R.id.title) is returning null. Check your app in hierarchyviewer at the time you're doing the insert and make sure the view you think is there in the hierarchy is actually there at the time you're processing the insert code.