VLC Android Intent URI Issue
Posted: 02 Sep 2020 04:13
Something is off with Intents.
if I do:
it won't work at all.
But if "file:///storage/emulated/0/Music/somemusicfile.mp3" is in an EditText it will play:
if I do:
Code: Select all
Uri urit = Uri.parse("file:///storage/emulated/0/Music/somemusicfile.mp3");
Intent vlcIntent = new Intent(Intent.ACTION_VIEW);
vlcIntent.setPackage("org.videolan.vlc.debug");
vlcIntent.setDataAndTypeAndNormalize(urit, "audio/*");
vlcIntent.putExtra("from_start", true);
startActivity(vlcIntent);
But if "file:///storage/emulated/0/Music/somemusicfile.mp3" is in an EditText it will play:
Code: Select all
Uri urit = Uri.parse(uritext.getText().toString());
Intent vlcIntent = new Intent(Intent.ACTION_VIEW);
vlcIntent.setPackage("org.videolan.vlc.debug");
vlcIntent.setDataAndTypeAndNormalize(urit, "audio/*");
vlcIntent.putExtra("from_start", true);
startActivity(vlcIntent);