我使用报警经理及彼本地通知待定意图是我的代码,它完美地运行,所有报警和通知在适当的时候来了。但我想,当我点击通知它应该去Act_Remainder
类在我的应用程序。 如何解决这个问题?报警管理器(通知)
Intent intent1 = newIntent(this.getApplicationContext(), Act_Remainder.class);
if(intent!=null){
userID = intent.getStringExtra("UserID");
userID1 = intent.getStringExtra("UserID1");
ID = intent.getIntExtra("ID", 0);
}
Notification notification = new Notification(R.drawable.ioc_icon,
userID1, System.currentTimeMillis());
intent1.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingNotificationIntent = PendingIntent.getActivity(this.getApplicationContext(), 0, intent1, PendingIntent.FLAG_ONE_SHOT);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
Thannx所有编辑我的问题,但任何人都可以帮我解决这个问题????????? – krishna
replce PendingIntent.FLAG_ONE_SHOT to PendingIntent.FLAG_UPDATE_CURRENT –
@Lucky我也试过这个,但它在未知的时间发送一个空白通知,意味着1小时或半小时之后......这个时间不确定 – krishna