Skip to content

Instantly share code, notes, and snippets.

@bbody
Last active December 17, 2015 00:29
Show Gist options
  • Save bbody/5521760 to your computer and use it in GitHub Desktop.
Save bbody/5521760 to your computer and use it in GitHub Desktop.
A bad example of a need for refactoring and UI decoupling
private void setupDirectionSpinner(){
busStop = inputTextEdit.getText().toString();
boundSpinner = (Spinner) this.findViewById(R.id.boundSpinner);
// Set up bound list
boundList = new ArrayList<String>();
boundList.add("Direction");
boundList.addAll(dbhelper.getDirections(busStop));
// Set up adapter
boundAdapter = new ArrayAdapter<String>(getBaseContext(),
android.R.layout.simple_dropdown_item_1line, boundList);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment