@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    mSpinnerEntries = getSpinnerItems();
    mUri = sampleUris().createSampleUri(ImageUriProvider.ImageSize.L);

    mButton = (Button) view.findViewById(R.id.button);
    mImage = view.findViewById(R.id.image);
    mSpinner = (Spinner) view.findViewById(R.id.spinner);

    mSpinner.setAdapter(new SimplePostprocessorAdapter());
    mSpinner.setOnItemSelectedListener(
        new AdapterView.OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            final Entry spinnerEntry = mSpinnerEntries.get(position);
            setPostprocessor(spinnerEntry.postprocessor);
          }

          @Override
          public void onNothingSelected(AdapterView<?> parent) {}
        });
    mSpinner.setSelection(0);

    mButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            final Entry spinnerEntry = mSpinnerEntries.get(mSpinner.getSelectedItemPosition());
            setPostprocessor(spinnerEntry.postprocessor);
          }
        });
  }
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/ImagePipelinePostProcessorFragment.java