Most media players have the MediaPlayer owned by a Service, to handle this scenario, plus to allow the media to keep playing even after the user presses HOME or otherwise leaves the app.
On Sun, Jun 5, 2011 at 3:10 PM, Hitendrasinh Gohil <[email protected]> wrote: >> Hi mark, >> > > thankx a lot i have resolve with the help of postdelayed. > > "3. Do not put a MediaPlayer in a static data member, as you appear to > have done with LocalMediaPlayer. Static data members should be avoided > where possible, and I fail to see why this case would be necessary." > > I have three classess i)list of songs ii)mediaplayer class that handles > play,next,previous etc iii)playerview class on which there are buttons for > next,play/pause and previous. > > I have used static mediaplayer because i can easily get the mediaplayer > objects i.e LocalMediaPlayer.mediaplayer.getDuration(); > > if this is wrong way or not a better way then can u suggest me the best way? > > > > > > > > -- > 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 -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.0 Programming Books: http://commonsware.com/books -- 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

