private Spinner setUpSpinner(int id, int arrayId) {
    Spinner spinner = (Spinner) findViewById(id);
    ArrayAdapter<CharSequence> adapter =
        ArrayAdapter.createFromResource(this, arrayId, android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);
    return spinner;
  }
An Activity that shows a form UI allowing users to define a custom job.
testapp/src/main/java/com/firebase/jobdispatcher/testapp/JobFormActivity.java