@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    mImage = (ImageView) view.findViewById(R.id.image);
    reloadImage(SPINNER_ENTRIES_MODES.get(0));

    final Spinner modeSpinner = (Spinner) view.findViewById(R.id.spinner_mode);
    modeSpinner.setAdapter(new SimpleModeOptionsAdapter());
    modeSpinner.setOnItemSelectedListener(
        new AdapterView.OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            DownsampleMode newMode = SPINNER_ENTRIES_MODES.get(position);
            reloadImage(newMode);
          }

          @Override
          public void onNothingSelected(AdapterView<?> parent) {}
        });
  }
Fragment that illustrates how to use the image pipeline directly in order to create
notifications.
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imagepipeline/ImagePipelineDownsampleFragment.java