getApplicationContext()
当我通过扩展的适配器类在我的应用程序中设置通知时出现错误PagerAdapter
。下面是我的代码:
Calendar cal = Calendar.getInstance();
cal.set(Calendar.MONTH,6);
cal.set(Calendar.YEAR, 2013);
cal.set(Calendar.DAY_OF_MONTH, 26);
cal.set(Calendar.HOUR_OF_DAY,12);
cal.set(Calendar.MINUTE,31);
//cal.add(Calendar.MINUTE, 5);
Intent alarmintent = new Intent(getApplicationContext(), AlarmReceiver.class);
alarmintent.putExtra("title","Reminder");
alarmintent.putExtra("note"," is in few minutes.");
PendingIntent sender = PendingIntent.getBroadcast(getApplicationContext(), HELLO_ID,
alarmintent,PendingIntent.FLAG_UPDATE_CURRENT| Intent.FILL_IN_DATA);
// AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);
任何人都可以帮助我。此致。