This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
/**
* 闹钟初始化接收器,用于设置便签的闹钟提醒。
*/
public class AlarmInitReceiver extends BroadcastReceiver {
// 查询字段
private static final String [] PROJECTION = new String [] {
NoteColumns.ID, // 便签ID
NoteColumns.ALERTED_DATE // 便签的提醒日期
};
// 查询字段对应的列索引
private static final int COLUMN_ID = 0;
private static final int COLUMN_ALERTED_DATE = 1;
/**
* 接收到广播时调用。
* @param context 上下文对象
* @param intent 广播时传递的Intent
*/
@Override
public void onReceive(Context context, Intent intent) {
// 获取当前日期
long currentDate = System.currentTimeMillis();
// 查询所有未提醒且类型为便签的便签项
Cursor c = context.getContentResolver().query(Notes.CONTENT_NOTE_URI,