You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
623 B
19 lines
623 B
package net.micode.notes.ui;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
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);
|
|
//用来启动AlarmAlertActivity
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
//activity要存在于activity的栈中
|
|
//所以要新起一个栈装入启动的activity
|
|
context.startActivity(intent);
|
|
}
|
|
} |