/*
 * Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.实现alarm这个功能最接近用户层的包
 */

package net.micode.notes.ui;//这个类包含在 net.micode.notes.ui包里
//导入各种类
import android.content.BroadcastReceiver;//接收广播并启动 AlarmAlertActivity类
import android.content.Context;//环境
import android.content.Intent;//文本

public class AlarmReceiver extends BroadcastReceiver {//闹钟接收器，继承自广播接收器
    @Override
    public void onReceive(Context context, Intent intent) {//保持持续的监听状态
        intent.setClass(context, AlarmAlertActivity.class);从当前的Intent启动AlarmAlertActivity，即组件之间的跳转
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//为该intent添加flag，使其加入一个新的task栈中
        context.startActivity(intent);//启动该intent所连接的类。
    }
}
