@Override
          public void onInactive() {
            // Forward the inactive callback to the backend if needed
            if (animationBackend
                instanceof AnimationBackendDelegateWithInactivityCheck.InactivityListener) {
              ((AnimationBackendDelegateWithInactivityCheck.InactivityListener) animationBackend)
                  .onInactive();
            }
            Toast.makeText(context, "Animation backend inactive.", Toast.LENGTH_SHORT).show();
          }
Wraps the given animation backend with an activity check. When no frame has been drawn for more
than 2 seconds, an inactivity toast message will be displayed.

@param context the context to be used for displaying the toast message
@param animationBackend the backend to wrap with the inactivity check
@return the wrapped backend to use
samples/animation2/src/main/java/com/facebook/samples/animation2/utils/AnimationBackendUtils.java