public static void detachShell() { // Basically, contentView of Activity, we're doing the opposite of setContentView ViewGroup parent = (ViewGroup) mShell.getParent(); parent.removeView(mShell); // Clear out activity specific stuff from shell clearActionsMenu(); unbindDrawables(mShell.findViewById(R.id.content_container)); }