[Android] Use itemTitle when passed to VideoPlayerActivity

Geoffrey Métais git at videolan.org
Mon Feb 9 11:30:47 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan 21 16:49:47 2015 +0100| [3cac4a37692f029d810772f865b15b56a6323623] | committer: Geoffrey Métais

Use itemTitle when passed to VideoPlayerActivity

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=3cac4a37692f029d810772f865b15b56a6323623
---

 .../vlc/gui/video/VideoPlayerActivity.java         |   26 +++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index aa00b6c..9b68bbb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2440,20 +2440,22 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
              }
 
             // Get the title
-            try {
-                title = URLDecoder.decode(mLocation, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-            } catch (IllegalArgumentException e) {
-            }
-            if (title.startsWith("file:")) {
-                title = new File(title).getName();
-                int dotIndex = title.lastIndexOf('.');
-                if (dotIndex != -1)
-                    title = title.substring(0, dotIndex);
+            if (itemTitle == null) {
+                try {
+                    title = URLDecoder.decode(mLocation, "UTF-8");
+                } catch (UnsupportedEncodingException e) {
+                } catch (IllegalArgumentException e) {
+                }
+                if (title.startsWith("file:")) {
+                    title = new File(title).getName();
+                    int dotIndex = title.lastIndexOf('.');
+                    if (dotIndex != -1)
+                        title = title.substring(0, dotIndex);
+                }
             }
-        } else if(itemTitle != null) {
-            title = itemTitle;
         }
+        if (itemTitle != null)
+            title = itemTitle;
         mTitle.setText(title);
     }
 



More information about the Android mailing list