Cursor cursor = db.rawQuery(selectQuery, null); String[] columns = cursor.getColumnNames();
MatrixCursor cursor = new MatrixCursor(new String[]{"_id", "name", "age"}); String[] columns = cursor.getColumnNames();This code creates a new MatrixCursor object, sets its column names as an argument to the constructor, and then extracts the column names using the getColumnNames() method. The android.database.Cursor class is part of the Android SDK and does not require any additional package libraries.