[Android] Preserve mime type on media launch from 3rd party
Geoffrey Métais
git at videolan.org
Wed Jun 29 11:43:10 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jun 29 11:40:39 2016 +0200| [de5af7dab6abefcbfecded7eaf1b4f1fd1049fe6] | committer: Geoffrey Métais
Preserve mime type on media launch from 3rd party
> https://code.videolan.org/videolan/vlc-android/commit/de5af7dab6abefcbfecded7eaf1b4f1fd1049fe6
---
vlc-android/src/org/videolan/vlc/StartActivity.java | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/StartActivity.java b/vlc-android/src/org/videolan/vlc/StartActivity.java
index 818f4c7..3d92a9d 100644
--- a/vlc-android/src/org/videolan/vlc/StartActivity.java
+++ b/vlc-android/src/org/videolan/vlc/StartActivity.java
@@ -57,19 +57,16 @@ public class StartActivity extends Activity {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
if (intent != null && TextUtils.equals(intent.getAction(), Intent.ACTION_VIEW) && intent.getData() != null) {
- intent.setData(getUri(intent));
- if (intent.getType() != null && intent.getType().startsWith("video")) {
- intent.setClass(this, VideoPlayerActivity.class);
- startActivity(intent);
- } else {
+ intent.setDataAndType(getUri(intent), intent.getType());
+ if (intent.getType() != null && intent.getType().startsWith("video"))
+ startActivity(intent.setClass(this, VideoPlayerActivity.class));
+ else
MediaUtils.openUri(this, intent.getData());
- }
} else if (intent != null && TextUtils.equals(intent.getAction(), AudioPlayerContainerActivity.ACTION_SHOW_PLAYER)) {
startActivity(new Intent(this, VLCApplication.showTvUi() ? AudioPlayerActivity.class : MainActivity.class));
} else
startActivity(new Intent(this, VLCApplication.showTvUi() ? MainTvActivity.class : MainActivity.class));
finish();
- return;
}
private Uri getUri(Intent intent) {
More information about the Android
mailing list