From a2c865a4b76d8a0d36b770b719d6cdda73936a9e Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 22 Jan 2024 09:49:08 +0100 Subject: [PATCH] Some fixes --- .../java/app/fedilab/android/mastodon/helper/Helper.java | 1 + .../ui/fragment/timeline/FragmentMastodonTimeline.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/helper/Helper.java b/app/src/main/java/app/fedilab/android/mastodon/helper/Helper.java index 76128f89..d59928ca 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/mastodon/helper/Helper.java @@ -907,6 +907,7 @@ public class Helper { fragment = _fragment; } else { if (args != null) fragment.setArguments(args); + ft = fragmentManager.beginTransaction(); ft.add(containerViewId, fragment, tag); if (backStackName != null) ft.addToBackStack(backStackName); if(!fragmentManager.isDestroyed()) { diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonTimeline.java b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonTimeline.java index 5177cc65..d60087f1 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonTimeline.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonTimeline.java @@ -1144,7 +1144,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. } initializeStatusesCommonView(otherStatuses); })); - } else { + } else if(accountTimeline != null){ tempToken[0] = MainActivity.currentToken; tempInstance[0] = currentInstance; accountId[0] = accountTimeline.id; @@ -1155,12 +1155,12 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. } else { accountId[0] = accountIDInRemoteInstance; } - } else { + } else if(accountTimeline != null){ tempToken[0] = MainActivity.currentToken; tempInstance[0] = currentInstance; accountId[0] = accountTimeline.id; } - if (accountId[0] == null) { + if (accountId[0] == null && accountTimeline != null) { accountId[0] = accountTimeline.id; } displayStatuses(direction, accountId[0], tempInstance[0], tempToken[0], fetchStatus);