How does one check if a table exists in an Android SQLite database?

前端 未结 12 2179
栀梦
栀梦 2020-11-27 12:37

I have an android app that needs to check if there\'s already a record in the database, and if not, process some things and eventually insert it, and simply read the data fr

12条回答
  •  没有蜡笔的小新
    2020-11-27 13:15

    Yep, turns out the theory in my edit was right: the problem that was causing the onCreate method not to run, was the fact that SQLiteOpenHelper objects should refer to databases, and not have a separate one for each table. Packing both tables into one SQLiteOpenHelper solved the problem.

提交回复
热议问题