@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    if (Build.VERSION.SDK_INT >= 26) {
      // newer versions of android require the creation of notification channels to show
      // notifications to the user.
      createNotificationChannel();
    }

    final Button button = (Button) view.findViewById(R.id.button);
    button.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            createNotification();
          }
        });
  }
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