+ 2
In android studio how could we associate spinner and edittext...
android studio contain a tool called spinner and edit text , spinner is like" select from list " option and so edit text is editable , and i need to select something in that list, with respect to my selection ,edittext should be changed
2 Respuestas
+ 2
spinnername.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
// your code
//get the selected item from the array you passed
//to the spinner adapter by the position
//e.g.
editText.setText(yourItemsArray[position]);
}
@Override
public void onNothingSelected(AdapterView<?> parentView) {
}
});
+ 2
could u explain more plzzzz