run Alarm - Android android.app

Android examples for android.app:AlarmManager

Description

run Alarm

Demo Code

import android.content.Context;
import android.media.MediaPlayer;
import android.net.Uri;
import android.provider.MediaStore;

public class Main{

    public static void runAlarm(Context context, int alarm) {
        MediaPlayer mediaPlayer = MediaPlayer.create(context, alarm);
        mediaPlayer.setVolume(1, 1);/*w ww.  j  a  v  a 2 s .  c o m*/
        mediaPlayer.setLooping(true);
        mediaPlayer.start();
    }

}

Related Tutorials