get Default Alarm Uri - Android android.app

Android examples for android.app:AlarmManager

Description

get Default Alarm Uri

Demo Code

import android.net.Uri;
import android.provider.Settings;
import java.lang.reflect.Field;

public class Main{


    public static Uri getDefaultAlarmUri() {

        try {/*from   w w w  .  j a va  2 s. co m*/
            Field f = Settings.System.class
                    .getField("DEFAULT_ALARM_ALERT_URI");
            return (Uri) f.get(null);
        } catch (Exception e) {
            return Settings.System.DEFAULT_NOTIFICATION_URI;
        }
    }

}

Related Tutorials