Created
January 22, 2017 18:36
-
-
Save matzuk/5a603660c35a937f19bace40bb31098e to your computer and use it in GitHub Desktop.
3
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
public class MainActivity extends Activity { | |
@Inject | |
Presenter presenter; | |
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
MyApplication.getInstance().getAccountComponent("old account").inject(this); | |
presenter.startLoading(); | |
///// | |
changeAccountButton.setOnClickListener(() -> { | |
presenter.clearView(); | |
MyApplication.getInstance().resetAccountComponent(); | |
MyApplication.getInstance().getAccountComponent("new account").inject(this); | |
presenter.startLoading(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment