stop mediaplayer from previous activity

All your problems with Audio, Video and Images.

stop mediaplayer from previous activity

Postby marcjc » Mon Feb 15, 2010 3:40 am

Can anyone tell me how to stop media player that was started in a previous activity?

For ex. In activity-1 button pressed that did - mp.start(); then activity-2 starts for different layout with new buttons, then when button pressed, mp.stop is called, but does not stop the media from the first activity.

Thanks in advance.

-Marc
marcjc
Junior Developer
Junior Developer
 
Posts: 16
Joined: Tue Jan 05, 2010 3:16 pm

Top

Postby shishir.bobby » Sat Feb 27, 2010 8:46 am

m looking for the same solution...


did u find anything yet?



regards'
shishir.bobby
shishir.bobby
Experienced Developer
Experienced Developer
 
Posts: 76
Joined: Thu Apr 09, 2009 11:41 am

Postby senormoll » Wed Mar 03, 2010 3:39 pm

The mp in your new activity is an entirely different object than in Activity 1. You could possibly send an intent from Activity 2 to Activity 1, have Activity 1 call mp.stop and pass an intent right back to Activity 2.

The best way, AFAIK however, would be to make your mediaplayer a separate Service and then all of your activities can call upon it.
senormoll
Developer
Developer
 
Posts: 29
Joined: Tue Feb 23, 2010 2:50 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 15 guests