start the music service in each activity and stop it when you move to
the next activity by using following code--->.
MediaPlayer player;
player = MediaPlayer.create(this, R.raw.start);
player.setLooping(true); // Set looping
player.setVolume(100,100);
player.start();
....................
....................
player.stop();// stop the service
start new activity
..............
..............
// FOR killing the activities. you just use the following code...-->
Intent i = new Intent(this, FIRST_CLASS.class); //
write the name of first activity in place of FIRST_CLASS...
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this
method clear the all activities and redirect you to the first
activity
startActivity(i); ..... redirect to the first
activity.....
On Mar 2, 7:41 pm, rishabh agrawal <[email protected]> wrote:
> when i start my apps the music automatically starts but when close my
> apps it does not stop & continue play
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en