Moved binding logic to onPause and onResume