Skip to content

Instantly share code, notes, and snippets.

@ubundude
Last active December 16, 2015 16:59
Show Gist options
  • Save ubundude/5467419 to your computer and use it in GitHub Desktop.
Save ubundude/5467419 to your computer and use it in GitHub Desktop.
A spinner adapter delcaration
rSpinner = (Spinner)getView().findViewById(R.id.rSpinner);
ArrayAdapter<CharSequence> adapt = ArrayAdapter.createFromResource(getActivity(), R.array.reports,
android.R.layout.simple_spinner_item);
adapt.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
rSpinner.setAdapter(adapt);
rSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View v, int pos, long id) {
//Logic to handle button clicked
}
public void onNothingSelected(AdapterView<?> parent){
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment