Fix item activity reopening itself after syncing when the app is opened by a sync result notification

This commit is contained in:
Shinokuni 2020-04-17 21:51:50 +02:00
parent dad51d334a
commit fb48608068

View File

@ -202,10 +202,13 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
getAccountCredentials(accounts);
viewModel.setAccounts(accounts);
// the activity was just opened
if (drawer == null) {
drawer = drawerManager.buildDrawer(accounts);
drawer.setSelection(DrawerManager.ARTICLES_ITEM_ID);
updateDrawerFeeds();
openItemActivity(getIntent());
} else if (accounts.size() < drawerManager.getNumberOfProfiles() && !accounts.isEmpty()) {
drawerManager.updateHeader(accounts);
updateDrawerFeeds();
@ -225,7 +228,7 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
savedInstanceState.clear();
}
openItemActivity(getIntent());
});
}