diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-06-11 03:29:07 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-06-11 03:29:07 +0000 |
commit | 4b3bbf8e7e753033f15d8b4bc9dafd05cf1235bc (patch) | |
tree | a0ab2dce37dd5c217863cc8126a2289e8c3769f6 /app/src | |
parent | 2277c97cc0f922c527e5fbf16d6b468c558b953f (diff) | |
download | infinity-for-reddit-4b3bbf8e7e753033f15d8b4bc9dafd05cf1235bc.tar infinity-for-reddit-4b3bbf8e7e753033f15d8b4bc9dafd05cf1235bc.tar.gz infinity-for-reddit-4b3bbf8e7e753033f15d8b4bc9dafd05cf1235bc.tar.bz2 infinity-for-reddit-4b3bbf8e7e753033f15d8b4bc9dafd05cf1235bc.tar.lz infinity-for-reddit-4b3bbf8e7e753033f15d8b4bc9dafd05cf1235bc.tar.xz infinity-for-reddit-4b3bbf8e7e753033f15d8b4bc9dafd05cf1235bc.tar.zst infinity-for-reddit-4b3bbf8e7e753033f15d8b4bc9dafd05cf1235bc.zip |
Fix force stop when long pressing the toolbar in MainActivity in anonymous mode.
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java index 14c12d2e..ad7458f7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java @@ -1366,9 +1366,17 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb void goBackToTop() { if (viewPager.getCurrentItem() == 0) { - tab1.goBackToTop(); + if (mAccessToken != null && tab1 != null) { + tab1.goBackToTop(); + } else if (tab2 != null) { + tab2.goBackToTop(); + } } else if (viewPager.getCurrentItem() == 1) { - tab2.goBackToTop(); + if (mAccessToken != null && tab2 != null) { + tab2.goBackToTop(); + } else if (tab3 != null) { + tab3.goBackToTop(); + } } else { tab3.goBackToTop(); } |