improve dependency injection (#723)
This commit is contained in:
parent
61f3f6c928
commit
7f648b1acd
5 changed files with 28 additions and 27 deletions
|
|
@ -70,12 +70,13 @@ public abstract class SFragment extends BaseFragment {
|
|||
|
||||
@Inject
|
||||
public MastodonApi mastodonApi;
|
||||
@Inject
|
||||
public AccountManager accountManager;
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
AccountEntity activeAccount = TuskyApplication.getInstance(getContext()).getServiceLocator()
|
||||
.get(AccountManager.class).getActiveAccount();
|
||||
AccountEntity activeAccount = accountManager.getActiveAccount();
|
||||
if (activeAccount != null) {
|
||||
loggedInAccountId = activeAccount.getAccountId();
|
||||
loggedInUsername = activeAccount.getUsername();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue