hi All,
I'm trying to exit the application using the following code in my
mediaplayer app. While it works fine in the emulator(2.2) but when I run
the app on an actual device (with 2.3.4 ) it gives me ANR error. Would
appreciate if someone can point me what is going wrong.

----code snippet-----
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
.......

case R.id.exit:
Log.d(TAG, "Shutting down the service");
 if (mMediaPlayer != null) {
 mMediaPlayer.release();
mMediaPlayer = null;
// remove all notifications
 mNotificationManager.cancelAll();
timer.cancel();
finish();
 return true;

....
---code snippet-----
Just a note that I'm using notifications to show current song being played,
using Timer for continuously updating the seekbar for the current song
being played.

Appreciate your time. Many thanks.

Regards,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to