@Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (videoPlayerInterface != null) { videoPlayerInterface.onDestroy(); } videoPlayerInterface = null; if (controlsHandler != null) { controlsHandler.removeCallbacksAndMessages(null); } controlsHandler = null; appOffer = null; Drawable drawable = ctaImage.getDrawable(); if (drawable instanceof BitmapDrawable) { BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; Bitmap bitmap = bitmapDrawable.getBitmap(); bitmap.recycle(); } ctaImage.setImageDrawable(null); ctaImage.destroyDrawingCache(); ctaImage = null; ingamewallVideoLayout.removeAllViews(); ingamewallVideoLayout = null; System.gc(); }