由网友(挡风人)分享简介:我实施我要报警显示的信息(日期,时间..),如果它是可用的应用程序。有没有人知道如何获得报警信息?非常感谢I am implementing an application in which I have to display alarm info (day, time..) if it is available. I...
我实施我要报警显示的信息(日期,时间..),如果它是可用的应用程序。有没有人知道如何获得报警信息?非常感谢
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());
}
}
相关推荐
最新文章