I hope i explain the correctly…
What i want to do is be able to run a query and then get the first record of that query and put the characters into an character array, then i want to get the second query and put that into the same array depending on where it is suppose to be inserted into the array.
So for example…the first record from the query will have the string ‘hello’, i want this to be inserted into the array at position one. Then i want record two which will be ‘you’ to be inserted at position 6. so when the character array is out put it will display ‘hello you’
How do i go about doing this?
SQLiteDatabase db = dbs.getReadableDatabase();
String SQL = "SELECT * FROM Table";
Cursor cursor = db.rawQuery(SQL, null);
startManagingCursor(cursor);
char charac_array[];
charac_array = new char[10];
while (cursor.moveToNext()) {
???
}
That’s what you probably want:
UPDATE
To fill a char array from String
You’ll have to take care when s is less than 10 characters though.