Android Question Using an Intent and VIDEO_PLAY_FROM_SEARCH to Play a Video

Mahares

Expert
Licensed User
Longtime User
In an effort to learn about videos, I am trying to play a video on the device by searching for it without knowing its exact location. But, I get this error:
StartActivity(MyVideo)
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.media.action.VIDEO_PLAY_FROM_SEARCH flg=0x20000 launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } (has extras) }


Below is the full project code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    CallSubDelayed(Me, "PlayVideo")
End Sub

Sub PlayVideo
    Dim MyVideo As Intent
    Dim strsearch="dataentry" As String    'Name of video to view. Change it to your video name
    MyVideo.Initialize("android.media.action.VIDEO_PLAY_FROM_SEARCH", "")
    MyVideo.Action="android.media.action.VIDEO_PLAY_FROM_SEARCH"
    MyVideo.PutExtra("query", strsearch)
    StartActivity(MyVideo)
End Sub
Any clues to what I should do. Thank you
 
Top