diff --git a/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java b/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java index 4843f467..d95d5d6f 100644 --- a/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java @@ -109,6 +109,7 @@ public class HashTagActivity extends BaseActivity { pinned = new Pinned(); pinned.pinnedTimelines = new ArrayList<>(); } + this.pinned = pinned; pinnedTag = false; if (pinned.pinnedTimelines != null) { for (PinnedTimeline pinnedTimeline : pinned.pinnedTimelines) { @@ -173,6 +174,9 @@ public class HashTagActivity extends BaseActivity { unpinConfirm.setMessage(getString(R.string.unpin_timeline_description)); unpinConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unpinConfirm.setPositiveButton(R.string.yes, (dialog, which) -> { + if (pinned == null || pinned.pinnedTimelines == null) { + return; + } pinned.pinnedTimelines.remove(pinnedTimeline); try { new Pinned(HashTagActivity.this).updatePinned(pinned); diff --git a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java index c0a35a93..1c1c02af 100644 --- a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java @@ -113,6 +113,10 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload attachments = (ArrayList) b.getSerializable(Helper.ARG_MEDIA_ARRAY); status = (Status) b.getSerializable(Helper.ARG_STATUS); } + if (getSupportActionBar() != null) { + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayShowHomeEnabled(true); + } if (attachments == null || attachments.size() == 0) finish(); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMediaProfile.java b/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMediaProfile.java index fe42a549..160ca018 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMediaProfile.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMediaProfile.java @@ -90,7 +90,7 @@ public class FragmentMediaProfile extends Fragment { @Override public void federatedAccount(Account account) { - if (account != null) { + if (account != null && !requireActivity().isFinishing() && isAdded()) { accountId = account.id; accountsVM.getAccountStatuses(tempInstance, null, accountId, null, null, null, null, null, true, false, MastodonHelper.statusesPerCall(requireActivity())) .observe(getViewLifecycleOwner(), statuses -> initializeStatusesCommonView(statuses)); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java index 03021530..da9dd25b 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java @@ -1067,7 +1067,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. @Override public void federatedAccount(Account account) { - if (account != null) { + if (account != null && !requireActivity().isFinishing() && isAdded()) { accountIDInRemoteInstance = account.id; accountsVM.getAccountStatuses(tempInstance, null, accountIDInRemoteInstance, null, null, null, null, null, false, true, MastodonHelper.statusesPerCall(requireActivity())) .observe(getViewLifecycleOwner(), pinnedStatuses -> accountsVM.getAccountStatuses(tempInstance, null, accountIDInRemoteInstance, null, null, null, exclude_replies, exclude_reblogs, media_only, false, MastodonHelper.statusesPerCall(requireActivity()))