@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void excludeItemsFromTransitionIfLollipop() { Slide transition = new Slide(); transition.excludeTarget(android.R.id.statusBarBackground, true); transition.excludeTarget(R.id.toolbar, true); getWindow().setEnterTransition(transition); getWindow().setReturnTransition(transition); }