[Android] Prevent IllegalStateException on delete fail
Geoffrey Métais
git at videolan.org
Tue Jan 9 15:44:39 CET 2018
vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 9 09:49:36 2018 +0100| [3832e771446f0252b30a1d5fdb4974b44c8f23fc] | committer: Geoffrey Métais
Prevent IllegalStateException on delete fail
(cherry picked from commit 6ad0a79d8c7f116d8ca5f55721220396c292e9b7)
> https://code.videolan.org/videolan/vlc-android/commit/3832e771446f0252b30a1d5fdb4974b44c8f23fc
---
.../src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
index bb2ec3642..8a5678fc9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
@@ -208,11 +208,11 @@ public abstract class MediaBrowserFragment extends PlaybackServiceFragment imple
}
private void onDeleteFailed(MediaWrapper media) {
- UiTools.snacker(getView(), getString(R.string.msg_delete_failed, media.getTitle()));
+ if (isAdded()) UiTools.snacker(getView(), getString(R.string.msg_delete_failed, media.getTitle()));
}
protected void showInfoDialog(MediaLibraryItem item) {
- Intent i = new Intent(getActivity(), InfoActivity.class);
+ final Intent i = new Intent(getActivity(), InfoActivity.class);
i.putExtra(InfoActivity.TAG_ITEM, item);
startActivity(i);
}
More information about the Android
mailing list