sea*_*ges 14
这篇文章对此有一个很好的解释.无法保证AlarmClock应用程序将安装在您的应用程序所安装的每个设备上.例如,许多HTC手机用HTC自己的"世界时钟"应用程序取而代之.
但是,假设存在股票AlarmClock应用程序,您应该能够从其内容提供商处获取游标.见这个项目作为一个例子.
小智 8
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());
}
}
Run Code Online (Sandbox Code Playgroud)
使用此代码......您将获得所有详细信息.请享用!
| 归档时间: |
|
| 查看次数: |
15964 次 |
| 最近记录: |