It seems that the code wasn't executing earlier due to an incorrect if statement. However, now it is executing (the log outputs from that bit are showing up), but I am getting an NPE at:
mPlayer.setLooping(true); If I comment that one out, it gives an NPE at the start() part. The create() method is called in the onCreate. Since I don't actually use an intent to start that activity, just directly call the play() and stop() methods, would it be possible that the onCreate() is never called, and mPlayer stays null? Thanks On Sat, Jan 7, 2012 at 9:20 PM, Mark Murphy <[email protected]> wrote: > On Sat, Jan 7, 2012 at 10:38 AM, Kostya Vasilyev <[email protected]> > wrote: > > Don't you need to call prepare() before start()? > > Not when you use MediaPlayer.create() on a raw resource -- it comes, > um, pre-prepared. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > Android Training in NYC: http://marakana.com/training/android/ > > -- > 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 > -- Raghav Sood http://www.androidactivist.org/ - Author http://www.appaholics.in/ - Founder -- 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

