Venkat Papana
Venkat Papana

Reputation: 4937

android how to know ringtone length

I'm working on a sample code same as http://developer.android.com/guide/topics/media, I'm successfully playing the ringtone, but I want to know the length of the ringtone(in sec) or atleast a notification after end of the ringtone, so that i have to do some other task after playing the ringtone.

Thanks nehatha

Upvotes: 1

Views: 1229

Answers (1)

Fredrik
Fredrik

Reputation: 1312

Put it in a MediaPlayer. You dont have to play it just .prepare() it. Then you can ask MediaPlayer about the duration.

Upvotes: 2

Related Questions