Skip to content

Instantly share code, notes, and snippets.

@kebbbnnn
Created July 29, 2017 03:28
Show Gist options
  • Save kebbbnnn/52fa1b643983a58c5a788ea6d83b5f31 to your computer and use it in GitHub Desktop.
Save kebbbnnn/52fa1b643983a58c5a788ea6d83b5f31 to your computer and use it in GitHub Desktop.
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