获取使用默认的SDK启用的报警名单? [英] Get the list of enabled alarm using default sdk?

查看:239
本文介绍了获取使用默认的SDK启用的报警名单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找如何简单地得到所有启用报警的列表。
到目前为止,我发现了两件事情:

 字符串nextAlarm = Settings.System.getString(getContentResolver()
Settings.System.NEXT_ALARM_FORMATTED);

这个项目,但它使用

 公共静态最终乌里CONTENT_URI =
        Uri.parse(内容://com.android.deskclock/alarm);
ContentResolver的CR = getContentResolver();
光标C = NULL;
C = cr.query(
           CONTENT_URI,ALARM_QUERY_COLUMNS,
            NULL,NULL,DEFAULT_SORT_ORDER);

和通过这里CommonsWare 的为说:这不是Android SDK的一部分。它可能不会在所有设备上运行。它可能不会在所有目前的Andr​​oid版本。它可能不会对未来的Andr​​oid版本。它不记录。它不支持。

到目前为止,第一个作品,但给人只有一个,当我想所有的人报警。而第二个是不好的。

所以,我怎么能得到即将到来的警报列表?

在此先感谢。


解决方案

  

所以,我怎么能得到即将到来的警报列表?


您不能,任何比你可以得到从数百个用户使用其他的闹钟应用的即将到来的警报名单更多(分布在市场上取代 COM设备。 android.deskclock ,等等)。

I've been seeking how to simply get a list of all enabled alarm. So far I found two things:

String nextAlarm = Settings.System.getString(getContentResolver(),
Settings.System.NEXT_ALARM_FORMATTED);

And this project but it uses:

public static final Uri CONTENT_URI =
        Uri.parse("content://com.android.deskclock/alarm");
ContentResolver cr = getContentResolver();
Cursor c = null;
c = cr.query(
           CONTENT_URI, ALARM_QUERY_COLUMNS,
            null, null, DEFAULT_SORT_ORDER);

And as said by CommonsWare here: "This is not part of the Android SDK. It may not work on all devices. It may not work on all current Android versions. It may not work on future Android versions. It is not documented. It is not supported".

So far, the first one works but gives only one alarm when I want all of them. And the second one is just not good.

So how can I get a list of upcoming alarm ?

Thanks in advance.

解决方案

So how can I get a list of upcoming alarm ?

You can't, any more than you can get the "list of upcoming alarm" from the hundreds of other alarm clock apps that users use (distributed on the Market, on devices that replace com.android.deskclock, etc.).

这篇关于获取使用默认的SDK启用的报警名单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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