Created
January 22, 2017 18:35
-
-
Save matzuk/a8fd638f41d19e5a6807699f3c5137c2 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