How to get other values from the selected Spinner item in addition to that shown?

1

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;
    }
    
asked by anonymous 25.01.2018 / 13:56

1 answer

1

The information you can get from the selected Spinner item is just one that is stored in the ArrayList that is used by the Adapter.

25.01.2018 / 15:14