Fix force stop when long pressing the toolbar in MainActivity in anonymous mode.

This commit is contained in:
Alex Ning 2020-06-11 11:29:07 +08:00
parent 2277c97cc0
commit 4b3bbf8e7e

View File

@ -1366,9 +1366,17 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
void goBackToTop() { void goBackToTop() {
if (viewPager.getCurrentItem() == 0) { if (viewPager.getCurrentItem() == 0) {
if (mAccessToken != null && tab1 != null) {
tab1.goBackToTop(); tab1.goBackToTop();
} else if (viewPager.getCurrentItem() == 1) { } else if (tab2 != null) {
tab2.goBackToTop(); tab2.goBackToTop();
}
} else if (viewPager.getCurrentItem() == 1) {
if (mAccessToken != null && tab2 != null) {
tab2.goBackToTop();
} else if (tab3 != null) {
tab3.goBackToTop();
}
} else { } else {
tab3.goBackToTop(); tab3.goBackToTop();
} }