Android sqlite database query with the columns needed taken from a String[]



I have string array with columns I want to select:

String[] columns = {"col1", "col2", "col3"};

The columns might change in the future, but will always be a subset of available columns.

I cannot find a SQLiteDatabase API that lets me pass this array as columns. The only solution I have so far is to just string join the columns with , as separator and add it into my query string and perform a rawQuery.

Is there a better solution?

EDIT

The query is a JOIN query.


Related to : Android sqlite database query with the columns needed taken from a String[]

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .