Created
July 29, 2017 03:28
-
-
Save kebbbnnn/52fa1b643983a58c5a788ea6d83b5f31 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private View rootView; | |
@Override | |
public View onCreateView(int resourceId, LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | |
if (rootView != null) { | |
ViewGroup parent = (ViewGroup) rootView.getParent(); | |
if (parent == null) { | |
parent = container; | |
} | |
parent.removeView(rootView); | |
} else { | |
rootView = inflater.inflate(R.layout.fragment_empty, container, false); | |
} | |
return rootView; | |
} | |
@Override | |
public void onActivityCreated(@Nullable Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
new EmptyPresenter(getContext(), rootView, this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment