kiran
kiran

Reputation: 3264

How to find out if a song is playing or not?

I am developing an application.

Related to my application,

I want to know if any audio song is playing or not in the backgroud through any other music player apps or the default musicplayer come with mobile.

If anyone knows the solution please help me.

Upvotes: 0

Views: 216

Answers (1)

Alex Lockwood
Alex Lockwood

Reputation: 83301

You need to use isPlaying() in the MediaPlayer class.

isPlaying() will return false when the default MediaPlayer application is not currently playing, so you must be using some other music application that we are not aware of. You should probably post your code, if that is the case.

Upvotes: 1

Related Questions