Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun SQLiteDatabase.doesTableExist(tableName: String): Boolean {
- val sql = "SELECT name FROM sqlite_master WHERE type='table';"
- val c = rawQuery(sql, null)
- while (c.moveToNext()) {
- if (c.getString(0) == tableName) return true
- else continue
- }
- return false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement