Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对 android 中的 SQLiteHelper 有疑问。我使用单例类来控制所有数据库交互,所以它有一个 SQLite 对象。问题是,当我创建 SQLite 的新对象时,不会调用 onCreate 方法,然后,数据库没有初始化......我读到你必须实例化一个写入器或读取器才能调用该方法,但我已经做到了,它没有被称为......
会是什么?
谢谢...
如果数据库在早期版本中已经存在,则不会调用 onCreate。尝试卸载该应用程序,这将删除旧数据库。