If you are using the AppCompat v7 library, this is easy:
View decor = getWindow().getDecorView(); int actionBarId = R.id.action_bar_container; enterTransition.excludeTarget(decor.findViewById(actionBarId), true);
Unfortunately, the action panel container view identifier is not part of the public API, so if you are not using the AppCompat v7 library (that is, using the official library libraries), you will need to work around this using the following code to get the identifier:
int actionBarId = getResources().getIdentifier("action_bar_container", "id", "android");
Please note that this code will break if the action bar container identifier name changes in a future version of Android. I doubt it will ever change, though ...
See this post for any other related information.
source share