Android - How to get the selected item value from a spinner and put it into a string?

后端 未结 6 579
Happy的楠姐
Happy的楠姐 2020-12-31 15:28

i read many similar questions on this thread, but none of them help me... This is my code:

@Override
protected void onCreate(Bundle savedInstanceState) {
            


        
6条回答
  •  Happy的楠姐
    2020-12-31 16:18

    int position = Arrays.asList(getResources().getStringArray(R.array.country_value_array)).indexOf(address.getCountry());
    

    This will get index by the value.

提交回复
热议问题