dynamic add data to spinner but not update the data on the spinner

后端 未结 3 651
日久生厌
日久生厌 2021-01-26 16:45
 public class testAddSpiner extends Activity {
private Spinner m_myDynamicSpinner;
private EditText m_addItemText;
private ArrayAdapter m_adapterForS         


        
3条回答
  •  北海茫月
    2021-01-26 16:53

    addButton.setOnClickListener(new OnClickListener(){
    
            @Override
            public void onClick(View v) {               
                addNewSpinnerItem();
              int a=  m_adapterForSpinner.getCount();
                m_myDynamicSpinner.setSelection(a-1);
    
               // m_adapterForSpinner.notifyDataSetChanged();
            }                   
        });
    

提交回复
热议问题