Example usage for android.provider AlarmClock ACTION_SHOW_ALARMS

List of usage examples for android.provider AlarmClock ACTION_SHOW_ALARMS

Introduction

In this page you can find the example usage for android.provider AlarmClock ACTION_SHOW_ALARMS.

Prototype

String ACTION_SHOW_ALARMS

To view the source code for android.provider AlarmClock ACTION_SHOW_ALARMS.

Click Source Link

Document

Activity Action: Show the alarms.

Usage

From source file:com.forrestguice.suntimeswidget.AlarmDialog.java

/**
 * @param context a context used to start the "show alarm" intent
 */// ww  w . ja v  a  2 s  . c o m
@TargetApi(Build.VERSION_CODES.KITKAT)
public static void showAlarms(Activity context) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        Intent alarmsIntent = new Intent(AlarmClock.ACTION_SHOW_ALARMS);
        alarmsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        if (alarmsIntent.resolveActivity(context.getPackageManager()) != null) {
            context.startActivity(alarmsIntent);
        }
    }
}