tags:

views:

39

answers:

1

Invoked device native player to play audio file, it opens android native player on top of the application but when selecting to back out or return to the application, device automatically stops playing the current media.

Sample code:

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"audio/*");
startActivity(intent);

How can I implement so that Device should continue to play audio in the background when selecting to back out or return to the application

Thanks in Advance.

A: 

You can start player without starting the native app. See example here: http://stackoverflow.com/questions/3533837/mediaplayer-setdatasource-and-prepare-not-working-android/3535700#3535700

Konstantin Burov
Thanks for you reply,but my project requirement is to play via Native Player.Further suggestion plz.
AndDev
I don't think that native player support that.
Konstantin Burov
Plz let me know if anyone has the perfect answer.
AndDev