Last active
August 14, 2018 14:35
-
-
Save catalinghita8/7d002f2e73b6be84344c684bdbb9e6a2 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
public class MessageActivity extends DaggerAppCompatActivity { | |
@Inject | |
MessageFragment mInjectedFragment; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_message); | |
// Set up fragment | |
MessageFragment fragment = | |
(MessageFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame); | |
if (fragment == null) { | |
fragment = mInjectedFragment; | |
ActivityUtils.addFragmentToActivity(getSupportFragmentManager(), fragment, R.id.contentFrame); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment