@Override
          public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            switch (TriggerType.getByPosition(position)) {
              case TIMED_TRIGGER:
                timePanel.setVisibility(View.VISIBLE);
                uriPanel.setVisibility(View.GONE);
                break;
              case CONTENT_URI_TRIGGER:
                timePanel.setVisibility(View.GONE);
                uriPanel.setVisibility(View.VISIBLE);
                break;
              case NOW_TRIGGER:
                timePanel.setVisibility(View.GONE);
                uriPanel.setVisibility(View.GONE);
                break;
              default:
                Log.e(TAG, "Unknown trigger was selected.");
                break;
            }
          }
An Activity that shows a form UI allowing users to define a custom job.
testapp/src/main/java/com/firebase/jobdispatcher/testapp/JobFormActivity.java