[Android] MediaInfoFragment: prevent NPE

Geoffrey Métais git at videolan.org
Thu Mar 10 15:26:06 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 10 15:25:36 2016 +0100| [edfe861aa32ad6fb325dc03e4017a069111d7c27] | committer: Geoffrey Métais

MediaInfoFragment: prevent NPE

> https://code.videolan.org/videolan/vlc-android/commit/edfe861aa32ad6fb325dc03e4017a069111d7c27
---

 .../src/org/videolan/vlc/gui/video/MediaInfoFragment.java      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
index 76967c1..d7ad629 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
@@ -102,11 +102,6 @@ public class MediaInfoFragment extends ListFragment {
         mPlayButton = (FloatingActionButton) v.findViewById(R.id.play);
         mDelete = (ImageButton) v.findViewById(R.id.info_delete);
         mSubtitles = (ImageView) v.findViewById(R.id.info_subtitles);
-
-        VLCApplication.runBackground(mCheckFile);
-        VLCApplication.runBackground(mLoadImage);
-
-        mPathView.setText(mItem == null ? "" : Uri.decode(mItem.getLocation().substring(7)));
         mPlayButton.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -137,8 +132,13 @@ public class MediaInfoFragment extends ListFragment {
             return;
         }
 
+        VLCApplication.runBackground(mCheckFile);
+        VLCApplication.runBackground(mLoadImage);
+
         ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(mItem.getTitle());
         mLengthView.setText(Strings.millisToString(mItem.getLength()));
+
+        mPathView.setText(Uri.decode(mItem.getUri().getPath()));
     }
 
     public void onStop(){



More information about the Android mailing list