Skip to content

Commit

Permalink
Prosposed fix for #425. Reloads history fragment when main activity r…
Browse files Browse the repository at this point in the history
…esumes.

Consolidated 'if statement' per Codacy suggestion
  • Loading branch information
Chris Walters committed Jul 23, 2018
1 parent 13bb9b8 commit 963b7a1
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,12 @@ protected void onResume() {
*/
super.onResume();

if (viewPager != null) {
if (viewPager != null && homePagerAdapter != null) {
int currentPage = viewPager.getCurrentItem();
if (currentPage == 1) { // assumption - history tab is always position 1
if (homePagerAdapter != null) {
HistoryFragment historyFragment = homePagerAdapter.getHistoryFragment();
if (historyFragment != null) {
historyFragment.reloadFragmentAdapter();
}
HistoryFragment historyFragment = homePagerAdapter.getHistoryFragment();
if (historyFragment != null) {
historyFragment.reloadFragmentAdapter();
}
}
}
Expand Down

0 comments on commit 963b7a1

Please sign in to comment.