我以后code以获得一个表的可用列名的Android?
I am after a code to get the available column names of a table in Android?
我看了看周围,并没有发现任何东西。
I looked around and didn't find anything.
这是一个简单的方法:
Cursor ti = db.rawQuery("PRAGMA table_info(mytable)", null);
if ( ti.moveToFirst() ) {
do {
System.out.println("col: " + ti.getString(1));
} while (ti.moveToNext());
}