Created
June 9, 2013 00:13
-
-
Save musicalbigfoot/5737064 to your computer and use it in GitHub Desktop.
Only inflate view if it doesnt exist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (rootView != null) { | |
ViewGroup parent = (ViewGroup) rootView.getParent(); | |
if (parent != null) | |
parent.removeView(rootView); | |
} | |
try { | |
rootView = inflater.inflate(tabLayout, container, false); | |
} catch (InflateException e) { | |
/* view is already there, just return view as it is */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment