Spinner does not show selected value

后端 未结 25 1351
-上瘾入骨i
-上瘾入骨i 2020-12-03 13:16

I have implemented the spinner by populating the array list through database.I can get and show the array list in my spinner array adapter but if I select the item in spinne

25条回答
  •  攒了一身酷
    2020-12-03 13:51

    try this code==>

    ArrayAdapter stateNameAdaptor = new ArrayAdapter(this,android.R.layout.simple_list_item_1, stateNameList);  
         stateNameAdaptor.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    
    spnState.setAdapter(stateNameAdaptor);
    

提交回复
热议问题