You will still have a cursor when querying your database, but as soon as you get the cursor, you can iterate over it by pulling the values you need into an array, for example:
DbAdapter db = new DbAdapter(mContext);
int columnIndex = 3;
db.open();
Cursor cursor = db.getAllMyFloats();
float[] myFloats = new float[cursor.getCount()-1];
if (cursor.moveToFirst())
{
for (int i = 0; i < cursor.getCount(); i++)
{
myFloats[i] = cursor.getFloat(columnIndex);
cursor.moveToNext();
}
}
cursor.close();
db.close();
source
share