Skip to content

Instantly share code, notes, and snippets.

@matzuk
Created January 22, 2017 18:35
Show Gist options
  • Save matzuk/a8fd638f41d19e5a6807699f3c5137c2 to your computer and use it in GitHub Desktop.
Save matzuk/a8fd638f41d19e5a6807699f3c5137c2 to your computer and use it in GitHub Desktop.
3
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