Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. fun SQLiteDatabase.doesTableExist(tableName: String): Boolean {
  2. val sql = "SELECT name FROM sqlite_master WHERE type='table';"
  3. val c = rawQuery(sql, null)
  4. while (c.moveToNext()) {
  5. if (c.getString(0) == tableName) return true
  6. else continue
  7. }
  8.  
  9. return false
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement