diff --git a/app/src/fdroid/java/app/fedilab/android/activities/PeertubeBaseMainActivity.java b/app/src/fdroid/java/app/fedilab/android/activities/PeertubeBaseMainActivity.java index 379bc276..595820f8 100644 --- a/app/src/fdroid/java/app/fedilab/android/activities/PeertubeBaseMainActivity.java +++ b/app/src/fdroid/java/app/fedilab/android/activities/PeertubeBaseMainActivity.java @@ -193,7 +193,11 @@ public abstract class PeertubeBaseMainActivity extends BaseActivity implements C super.onDestroy(); ChromeCasts.unregisterListener(this); if (manage_chromecast != null) { - unregisterReceiver(manage_chromecast); + try { + unregisterReceiver(manage_chromecast); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } new Thread(() -> { if (chromeCasts != null && chromeCasts.size() > 0) { for (ChromeCast cast : chromeCasts) { diff --git a/app/src/main/java/app/fedilab/android/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/BaseMainActivity.java index 4cadc14f..0e64e353 100644 --- a/app/src/main/java/app/fedilab/android/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/BaseMainActivity.java @@ -1859,9 +1859,12 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt @Override protected void onDestroy() { - unregisterReceiver(broadcast_data); - unregisterReceiver(broadcast_error_message); - + try { + unregisterReceiver(broadcast_data); + unregisterReceiver(broadcast_error_message); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } if (networkStateReceiver != null) { try { unregisterReceiver(networkStateReceiver); diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/ComposeActivity.java index cf9c72f5..6d9c24d5 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/ComposeActivity.java @@ -195,8 +195,11 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana if (timer != null) { timer.cancel(); } - unregisterReceiver(imageReceiver); - + try { + unregisterReceiver(imageReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } } diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java index ca082b02..f150faa7 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java @@ -367,7 +367,11 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload @Override public void onDestroy() { - unregisterReceiver(onDownloadComplete); + try { + unregisterReceiver(onDownloadComplete); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } super.onDestroy(); } diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java index ddc779bb..79f64b71 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java @@ -1260,7 +1260,11 @@ public class ProfileActivity extends BaseActivity { scheduledExecutorService.shutdownNow(); scheduledExecutorService = null; } - unregisterReceiver(broadcast_data); + try { + unregisterReceiver(broadcast_data); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } super.onDestroy(); } diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminActionActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminActionActivity.java index 005af5d3..8865ffa9 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminActionActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/admin/AdminActionActivity.java @@ -340,7 +340,11 @@ public class AdminActionActivity extends BaseBarActivity { protected void onDestroy() { super.onDestroy(); if (mReceiver != null) { - unregisterReceiver(mReceiver); + try { + unregisterReceiver(mReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } } } diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonContext.java b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonContext.java index d476ad8d..01cd0e2c 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonContext.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonContext.java @@ -295,7 +295,11 @@ public class FragmentMastodonContext extends Fragment { @Override public void onDestroyView() { - requireActivity().unregisterReceiver(receive_action); + try { + requireActivity().unregisterReceiver(receive_action); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } super.onDestroyView(); } diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonDirectMessage.java b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonDirectMessage.java index 91690c06..3c0a6164 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonDirectMessage.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonDirectMessage.java @@ -272,7 +272,11 @@ public class FragmentMastodonDirectMessage extends Fragment { @Override public void onDestroyView() { - requireActivity().unregisterReceiver(broadcast_data); + try { + requireActivity().unregisterReceiver(broadcast_data); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } super.onDestroyView(); } diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonNotification.java b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonNotification.java index a728dbb1..56b74026 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonNotification.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/timeline/FragmentMastodonNotification.java @@ -675,8 +675,13 @@ public class FragmentMastodonNotification extends Fragment implements Notificati @Override public void onDestroyView() { - requireActivity().unregisterReceiver(receive_action); - requireActivity().unregisterReceiver(receive_refresh); + + try { + requireActivity().unregisterReceiver(receive_action); + requireActivity().unregisterReceiver(receive_refresh); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } if (isAdded()) { storeMarker(); } diff --git a/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeActivity.java b/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeActivity.java index ea6b87fc..cab6b84f 100644 --- a/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeActivity.java @@ -1596,7 +1596,11 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis private void unregisterReceiver() { if (mPowerKeyReceiver != null) { - unregisterReceiver(mPowerKeyReceiver); + try { + unregisterReceiver(mPowerKeyReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } mPowerKeyReceiver = null; } } diff --git a/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java b/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java index daf4b4a6..3e56a2b6 100644 --- a/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java +++ b/app/src/main/java/app/fedilab/android/peertube/activities/PeertubeMainActivity.java @@ -153,7 +153,11 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity { if (!keepRemote) { typeOfConnection = TypeOfConnection.NORMAL; } - unregisterReceiver(broadcast_data); + try { + unregisterReceiver(broadcast_data); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } } @SuppressLint("ApplySharedPref") diff --git a/app/src/main/java/app/fedilab/android/peertube/services/RetrieveInfoService.java b/app/src/main/java/app/fedilab/android/peertube/services/RetrieveInfoService.java index 2411e4d2..a4b4842c 100644 --- a/app/src/main/java/app/fedilab/android/peertube/services/RetrieveInfoService.java +++ b/app/src/main/java/app/fedilab/android/peertube/services/RetrieveInfoService.java @@ -125,7 +125,11 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver super.onDestroy(); if (networkStateReceiver != null) { networkStateReceiver.removeListener(this); - unregisterReceiver(networkStateReceiver); + try { + unregisterReceiver(networkStateReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } } } diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/501.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/501.txt index 236f4841..29fe31fe 100644 --- a/src/fdroid/fastlane/metadata/android/en/changelogs/501.txt +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/501.txt @@ -1,7 +1,7 @@ Added: - Android 14 support - Automatically split long messages in threads (default: ASK) -- Links and media are clickable when composing +- Links and media are clicka ble when composing Fixed: - Avoid error 429 with NTFY