[Android] [PATCH 16/24] Pass the title as well when switiching vout
Edward Wang
edward.c.wang at compdigitec.com
Wed Aug 22 23:15:16 CEST 2012
---
vlc-android/src/org/videolan/vlc/AudioService.java | 1 +
.../vlc/gui/video/VideoPlayerActivity.java | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index 07042a2..678a802 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -316,6 +316,7 @@ public class AudioService extends Service {
Intent intent = new Intent(VLCApplication.getAppContext(), VideoPlayerActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
intent.putExtra("itemLocation", mCurrentMedia.getLocation());
+ intent.putExtra("itemTitle", mCurrentMedia.getTitle());
// Don't lose the currently playing stream
intent.putExtra("dontParse", true);
startActivity(intent);
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 82a4382..892b1a2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1106,8 +1106,9 @@ public class VideoPlayerActivity extends Activity {
*/
private void load() {
mLocation = null;
- String title = null;
+ String title = getResources().getString(R.string.title);
boolean dontParse = false;
+ String itemTitle = null;
if (getIntent().getAction() != null
&& getIntent().getAction().equals(Intent.ACTION_VIEW)) {
@@ -1116,6 +1117,7 @@ public class VideoPlayerActivity extends Activity {
} else if(getIntent().getExtras() != null) {
/* Started from VideoListActivity */
mLocation = getIntent().getExtras().getString("itemLocation");
+ itemTitle = getIntent().getExtras().getString("itemTitle");
dontParse = getIntent().getExtras().getBoolean("dontParse");
}
@@ -1138,7 +1140,9 @@ public class VideoPlayerActivity extends Activity {
if (dotIndex != -1)
title = title.substring(0, dotIndex);
}
- mTitle.setText(title);
+ } else if(itemTitle != null) {
+ title = itemTitle;
}
+ mTitle.setText(title);
}
}
--
1.7.5.4
More information about the Android
mailing list