Reputation: 1927
I was wondering what I could use to replace the deprecated Notification class
and the setLatestEventInfo()
method. It's not recognizing the setLatestEventInfo()
method.
Here is the current code I have:
public void makeForeground() {
Notification notification = new Notification(R.drawable.icon, getText(R.string.servicename), System.currentTimeMillis());
notification.setLatestEventInfo(this, getText(R.string.servicename), this.lang[134], PendingIntent.getActivity(this, 0, new Intent(this, UIActivity.class), 0));
startForeground(2, notification);
}
What can I replace this with?
Upvotes: 2
Views: 418
Reputation: 29814
You can use NotificationCompat for replacing Notification.
You can read it here more:
Upvotes: 1