public void SetAlarm(Context context, int sec)
{
AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(context, Alarm.class);
PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);
am.set(AlarmManager.RTC, System.currentTimeMillis()+1000*5 , pi);
i = new Intent(context, Alarm.class);
pi = PendingIntent.getBroadcast(context, 0, i, 0);
am.set(AlarmManager.RTC, System.currentTimeMillis()+1000*10 , pi);
}
为什么 onReceive 在 10 秒后只工作一次?