获取报警信息来源 [英] Get alarm infomation

查看:213
本文介绍了获取报警信息来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实施我要报警显示的信息(日期,时间..),如果它是可用的应用程序。有没有人知道如何获得报警信息?
非常感谢

I am implementing an application in which I have to display alarm info (day, time..) if it is available. Is there anybody know how to access to alarm info? Thanks so much

推荐答案

尝试这样的事情

final String tag_alarm = "tag_alarm";
Uri uri = Uri.parse("content://com.android.alarmclock/alarm")
Cursor c = getContentResolver().query(uri, null, null, null, null);
Log.i(tag_alarm, "no of records are" + c.getCount());
Log.i(tag_alarm, "no of columns are" + c.getColumnCount());
if (c != null) {
    String names[] = c.getColumnNames();
    for (String temp : names) {
        System.out.println(temp);
    }
    if (c.moveToFirst()) {
        do {
            for (int j = 0; j < c.getColumnCount(); j++) {
                Log.i(tag_alarm, c.getColumnName(j);
                        + " which has value " + c.getString(j));
            }
        } while (c.moveToNext());
    }
}

这篇关于获取报警信息来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆