Android - how to open an audio-stream url with an external app? -


i want give user choice of opening audio stream url audio player have installed.

the following code works far user getting list of installed audio apps , can choose between then.

intent intent = new intent(); intent.setaction(intent.action_view); intent.setdataandtype(uri.parse(stream.getaudio()), "audio/*"); startactivity(intent); 

but open intent lives inside app only. therefor playback stop if user closes app. how can change behaviour not new activity started whole app launched , detached app.

i guess it's because audio player opened in same task stack of app. try intent.flag_activity_new_task start new task, like:

intent.setflags(intent.flag_activity_new_task); 

see tasks , stack learn more.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -