Created
May 16, 2018 03:09
-
-
Save Morgazmo/251948382fb7f485b436bb38cae83f5e to your computer and use it in GitHub Desktop.
Method
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
@NonNull | |
private MyFragment findOrCreateViewFragment() { | |
MyFragment myFragment = (MyFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame); | |
if (myFragment == null) { | |
Log.d(TAG, "createFragment"); | |
myFragment = myFragment.newInstance(); | |
ActivityUtils.replaceFragmentInActivity(getSupportFragmentManager(), myFragment, R.id.contentFrame); | |
} | |
return myFragment; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment