Doubt:
How do I find the value of the handle
field for nome
that was selected in Spinner
?
Scenario:
Table clientes
Fields _id, handle, nome
The ArrayList
of Spinner
is created as follows:
public ArrayList<String> getClientes(){
sqLiteDatabase = banco.getReadableDatabase();
ArrayList<String> clientes = new ArrayList<>();
Cursor cursor = sqLiteDatabase.rawQuery("SELECT nome FROM clientes ORDER BY nome", null);
if(cursor != null && cursor.moveToFirst()){
do{
clientes.add(cursor.getString(cursor.getColumnIndex("nome")));
}while(cursor.moveToNext());
}
return clientes;
}