private void createNotification() {
    final ImagePipeline imagePipeline = Fresco.getImagePipeline();
    final ImageRequest imageRequest =
        ImageRequest.fromUri(sampleUris().createSampleUri(ImageUriProvider.ImageSize.S));

    final DataSource<CloseableReference<CloseableImage>> dataSource =
        imagePipeline.fetchDecodedImage(imageRequest, null);

    dataSource.subscribe(
        new BaseBitmapDataSubscriber() {

          @Override
          protected void onNewResultImpl(Bitmap bitmap) {
            displayNotification(bitmap);
          }

          @Override
          protected void onFailureImpl(DataSource<CloseableReference<CloseableImage>> dataSource) {
            showToastText("Failed to fetch image directly: " + dataSource.getFailureCause());

            // In general, failing to fetch the image should not keep us from displaying the
            // notification. We proceed without the bitmap.
            displayNotification(null);
          }
        },
        UiThreadImmediateExecutorService.getInstance());
  }
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/ImagePipelineNotificationFragment.java