Я работаю над уведомлениями, и мне нужно использовать setLatestEventInfo
. Однако в Android Studio отображается следующее сообщение об ошибке:
не может разрешить метод setLatestEventinfo
Вот мой фрагмент кода:
private void createNotification(Context context, String registrationID) {
NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.icon,"Registration Successfull",System.currentTimeMillis());
notification.flags |= Notification.FLAG_AUTO_CANCEL;
Intent intent = new Intent(context,RegistrationResultActivity.class);
intent.putExtra("registration_ID",registrationID);
PendingIntent pendingIntent = PendingIntent.getActivity(context,0,intent,0);
notification.setLatestEventInfo(context,"Registration","Successfully Registered",pendingIntent);
}
Или, если это другой способ сделать это, любезно предложите мне это.