summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2019-12-19 16:52:37 +0100
committerByteHamster <info@bytehamster.com>2019-12-19 16:52:37 +0100
commit6785eb7689e3010c455b0b49db46671fe93d5f46 (patch)
treeb480ce9f9b5705072ccf11ab8ee38c967cfc94f4 /app/src
parentecad7bdf94f67f2495d24151919e48d234a906bf (diff)
downloadAntennaPod-6785eb7689e3010c455b0b49db46671fe93d5f46.zip
Do not crash when clicking menu items while loading
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java5
2 files changed, 9 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
index 3b843e150..79637d79a 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
@@ -214,6 +214,10 @@ public class FeedInfoFragment extends Fragment {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
+ if (feed == null) {
+ Toast.makeText(getContext(), R.string.please_wait_for_data, Toast.LENGTH_LONG).show();
+ return super.onOptionsItemSelected(item);
+ }
boolean handled = false;
try {
handled = FeedMenuHandler.onOptionsItemClicked(getContext(), item, feed);
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
index f03aef207..33343948f 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
@@ -19,6 +19,7 @@ import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
+import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.SearchView;
import androidx.core.view.MenuItemCompat;
@@ -235,6 +236,10 @@ public class FeedItemlistFragment extends ListFragment {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (!super.onOptionsItemSelected(item)) {
+ if (feed == null) {
+ Toast.makeText(getContext(), R.string.please_wait_for_data, Toast.LENGTH_LONG).show();
+ return true;
+ }
try {
if (!FeedMenuHandler.onOptionsItemClicked(getActivity(), item, feed)) {
switch (item.getItemId()) {