code: public void onDetach() {
      if (!mIsAttached) {
        return;
      }
      mIsAttached = false;
      for (int i = 0; i < mHolders.size(); ++i) {
        mHolders.get(i).onDetach();
      }
    }
docs: Releases resources used to display the image.
  
  <p>The containing view must call this method from both {@link View#onStartTemporaryDetach()}
  and {@link View#onDetachedFromWindow()}.