Я работаю над уведомлениями, и мне нужно использовать setLatestEventInfo
. Тем не менее, Android Studio показывает следующее сообщение об ошибке:Невозможно решить метод setLatestEventInfo
не может решить метод 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);
}
Или, если их еще один способ сделать это, пожалуйста предложите мне это.
'setLatestEventInfo' является' 'устаревшее сделать это с помощью' NotificationCompat.Builder' –