mercredi 2 mars 2016

Cannot set value from sqlite to spinners?

Here is my requirement am having sqlite db am getting json response from server and saving it and setting that value to spinner its working fine but when i edit listview i need to edit the value of spinner set that value to spinners but not getting that i have tried everything let me post what i have tried so far: This is the adapter where am trying to set the spinners:

 final ArrayList<Model_Account> arrayobj = new ArrayList<Model_Account>();
            spinners_state_db = new Spinners_DB_State(getBaseContext());
            final Spinner_DB_AccountManagers acmobj = new Spinner_DB_AccountManagers(getBaseContext());

This where am setting selection value to spinners:

 modelobj.setName(((edit_accnt.getString(edit_accnt.getColumnIndex(Model_Account.State)))));
                    int position=0;
                    position=spinner_state_Adapter.getPosition(modelobj);
                    spinner_state.setSelection(position);

Always getting position -1 don't know where am making mistake am using material spinner!!

Aucun commentaire:

Enregistrer un commentaire