Bind data to combobox in Android
Note : Spinner is combobox control in android.
Spinner spinnerBox = (Spinner) findViewById(R.Id.spinner_box);
ArrayAdapter<Employees> adapterEmp = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, empolyees);
adapterEmp.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerBox.setAdapter(adapterEmp);
Note : Spinner is combobox control in android.
Spinner spinnerBox = (Spinner) findViewById(R.Id.spinner_box);
ArrayAdapter<Employees> adapterEmp = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, empolyees);
adapterEmp.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerBox.setAdapter(adapterEmp);
No comments:
Post a Comment