@Override
  public void showDuration(long startNs) {
    final float deltaMs = startNs / 1e6f;
    final String message = String.format((Locale) null, "Duration: %.1f ms", deltaMs);
    getActivity()
        .runOnUiThread(
            new Runnable() {
              @Override
              public void run() {
                Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show();
              }
            });
  }
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