Ich fragte mich, was ich verwenden könnte, um die deprecated Notification class
und die setLatestEventInfo()
Methode zu ersetzen. Es erkennt die setLatestEventInfo()
Methode nicht.Android - Ersatz für veraltete Notification-Klasse
Hier wird der aktuelle Code, den ich habe:
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);
}
Was kann ich ersetzen diese mit?
Mögliche Duplikat: http://stackoverflow.com/questions/32450449/setlatesteventinfo-cannot -be-resolved – REG1