Android: Unknown MediaPlayer Warning

I'm trying to get the duration of the media file using mediaplayer and all works fine but I'm getting a warning in he DDMS as below.

10-21 17:30:35.109: W/MediaPlayer(7564): mediaplayer went away with unhandled events

My code goes as below

//mediaPlayer object initiated to get the duration
MediaPlayer mediaPlayer;
mediaPlayer = new MediaPlayer();

try {
mediaPlayer.setDataSource(AudioListActivity.this, Uri.parse((db_results.get(position)).toString()));
} catch (IllegalArgumentException e) {
} catch (SecurityException e) {
} catch (IllegalStateException e) {

} catch (IOException e) {
//getting duration
int durationTime = 0;
TextView duration = (TextView) row.findViewById(;
durationTime = mediaPlayer.getDuration();

Can someone help me out. Thanks in advance.


It is better to ignore this warning.

1)comment the line of code MediaPlayer.release(); and notice the logcat;

2)You may need to reset the Mediaplayer object before releasing the mp. mp.reset() after that test it. Because some time this will cause other error like "illegal state exception"

3)If it is concern to you, do the reset it in try/catch and handle the exception.

add: mediaPlayer.reset(); before mediaPlayer.release();

Need Your Help

Linux script using tsql

sql sql-server database tsql

I made a script to connect to my sql server. when I copy my script into my terminal it works fine.

Are there Python ORMs out there that support multiple independent databases concurrently in use?

python orm

I'm writing an application in Python where I wish to use sqlite as the backing store for documents edited by the app, with documents generally living in memory, but being saved to disk-based databa...