摘要: 使用AlarmAlarm可以用来在未来某个时刻发出一个广播,从而唤醒应用程序。用这种机制来替代一个长期运行的Service。 1 String alarm = Context.ALARM_SERVICE; 2 AlarmManager am; 3 am = (AlarmManager) getSystemService(alarm); 4 5 Intent intent = new Intent("REFRESH_THIS"); 6 PendingIntent op = PendingIntent.getBroadcast(this, 0, intent, 0); 7 8 阅读全文
posted @ 2013-04-23 10:26 断桥残雪 阅读(253) 评论(0) 推荐(0) 编辑