private void deactivateCard(int currentItem) {
   final InlineCarouselCardState cardState = getCardState(currentItem);
   if (cardState != null) {
     if (cardState.isCurrentlyActive()) {
       final WeakReference<InlineCarouselCardView> currentCardRef =
           adapter.getExistingCard(currentItem);
       if (currentCardRef != null) {
         final InlineCarouselCardView currentCard = currentCardRef.get();
         if (currentCard != null) {
           currentCard.onCardDeactivated();
         }
       }
     }
   }
 }
  @Override
  public void onStop(Activity activity) {
    wasPaused = true;

    try {
      adapter.destroyCards();
      adapter = null;

      removeAllViews();

      carouselViewPager = null;
      singleCardView = null;
    } catch (Exception ex) {
      sdk.getLogger().w(TAG, "Error during activity stop", ex);
    }
  }