I trying the following code, but not successfully.
There is no activity on your system that both can play a video and is a music player.
First step is show the dialog (Android System & Browser) to choose.
The user can display this video in whatever application they want.
Second step : when I choose Android System, it shows the applications can play this video.
Presumably, that is occurring sometime after the URL has been downloaded or something. You might try using setDataAndType()
, supplying the proper MIME type, to streamline this a bit.
I want to press "Play" button, it will run by using system media application,
There is no "system media application". A device may have zero, one, or several applications capable of playing a video from a URL. Those applications can be pre-installed or installed by the user. When you request to play a video using ACTION_VIEW
, the OS and the user will decide which application will play the video.