MediaPlayer Mix up

All your problems with Audio, Video and Images.

MediaPlayer Mix up

Postby kdiddy » Wed Jul 15, 2009 3:10 am

I have an app thats going to play music but when the home or back button is pressed the music keeps playing. How do I get the app to recognize that those buttons are being pressed?

Thanks

K
Diddy
kdiddy
Junior Developer
Junior Developer
 
Posts: 19
Joined: Wed Apr 01, 2009 2:30 am

Top

Postby Zerger » Fri Sep 04, 2009 3:45 am

Hi you can override onDestroy in Activity.like this
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. @Override
  3.  
  4.     protected void onDestroy() {
  5.  
  6.         super.onDestroy();
  7.  
  8.         // TODO Auto-generated method stub
  9.  
  10.         if (mMediaPlayer != null) {
  11.  
  12.             mMediaPlayer.release();
  13.  
  14.             mMediaPlayer = null;
  15.  
  16.         }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Zerger
Freshman
Freshman
 
Posts: 2
Joined: Thu Jun 04, 2009 1:09 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 22 guests