stop Ringtone - Android Phone

Android examples for Phone:Sound

Description

stop Ringtone

Demo Code


//package com.java2s;

import android.media.MediaPlayer;

public class Main {
    private static MediaPlayer mediaPlayer = null;

    public static void stopRingtone() {
        if (mediaPlayer != null) {
            if (mediaPlayer.isPlaying()) {
                mediaPlayer.stop();/*from  w  ww  .ja  va 2s .co  m*/
            }
        }
    }
}

Related Tutorials