Hello, I need to figure out how to transform a Cursor with data coming from the Android Internal Database (SQLite) into a String or String Array.
I've tried it in some ways, but none of it has worked.
String lista = "Lista de Compras \n\n";
for (int i = 0; i <= cursor.getColumnCount(); i++){
lista.concat(cursor.getString(i)+ "\n");
}
And in the Database:
public Cursor buscaListaProdutos(){
SQLiteDatabase banco = getWritableDatabase();
Cursor c = banco.rawQuery("SELECT _id, nomeProduto, qtdeProduto FROM listaProduto", null);
if(c.moveToFirst()){
banco.close();
return c;
}else{
banco.close();
return null;
}
}