Android Question Google Play Music , Intent with extra - I need help

mickeyk600

Member
Licensed User
How do I write this in B4A :

public void playSearchArtist(String artist) {
Intent intent = new Intent(MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH);
intent.putExtra(MediaStore.EXTRA_MEDIA_FOCUS,
MediaStore.Audio.Artists.ENTRY_CONTENT_TYPE);
intent.putExtra(MediaStore.EXTRA_MEDIA_ARTIST, artist);
intent.putExtra(SearchManager.QUERY, artist);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}


Thanks
 

DonManfred

Expert
Licensed User
B4X:
    Dim i As Intent
    i.Initialize("android.media.action.MEDIA_PLAY_FROM_SEARCH","")
    i.PutExtra("android.intent.extra.focus","vnd.android.cursor.item/artist")
    i.PutExtra("android.intent.extra.artist","Bob Marley")
    i.PutExtra("query","Bob Marley")
    StartActivity(i)
 
Top