String[] categories = {"All","Surgeon","Pediatrician","Cardiologist","Dermatologist"}; ArrayAdapter aa = new ArrayAdapter(this,android.R.layout.simple_spinner_item,categories); aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //Setting the ArrayAdapter data on the Spinner drspin.setAdapter(aa); drspin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { String a = drspin.getSelectedItem().toString(); sd.setText(a); } @Override public void onNothingSelected(AdapterView<?> parent) { } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)