В целом, когда у меня есть уведомление об уведомлении на панели уведомлений и нажмите на него. Откроется зарегистрированное приложение для этого сообщения.
При активности стартапа, как определить, откроется ли приложение от него?
И лучше, как восстановить идентификатор уведомления на методе OnCreate ()?
Обновление : из @ovidiu - вот мой код в Putextra для нажимания
Notification notification = new Notification(icon, tickerText, System.currentTimeMillis());
notification.contentView = contentView;
Intent notificationIntent = new Intent(this, Startup.class);
notificationIntent.putExtra("JOBID", jobId);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_ONE_SHOT);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.contentIntent = contentIntent;
mNotificationManager.notify(jobId, notification);
и на основной активности «запуск». Код Java "-
Intent intent = this.getIntent();
if (intent != null && intent.getExtras() != null && intent.getExtras().containsKey("JOBID")) {
int jobID = this.getIntent().getExtras().getInt("JOBID");
if (jobID > 0) {
}
}
Intent. GTEXTRAS () Всегда возвращайте нуль. Оказывается, мне нужно пройти от yencedintent.flag_one_shot. Теперь он передан !!