Skip to content

Instantly share code, notes, and snippets.

@jorgevila
Created March 5, 2014 09:13
Show Gist options
  • Save jorgevila/9363820 to your computer and use it in GitHub Desktop.
Save jorgevila/9363820 to your computer and use it in GitHub Desktop.
Android SQLite Get Table Names
SQLiteDatabase database = dbHelper.getWritableDatabase();
Cursor c = database.rawQuery(
"SELECT name FROM sqlite_master WHERE type='table'", null);
Assert.assertNotNull(c);
String actual = "";
if (c.moveToFirst()) {
while (!c.isAfterLast()) {
actual += c.getString(0) + ",";
c.moveToNext();
}
}
c.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment