如何从我的代码中删除弃用?因此,我似乎收到了警告。删除线文本是“新通知”和 setLatestEventInfo?它说“此方法在 API 级别 11 中已弃用?这是什么意思?请帮忙。我该如何解决这个问题?
@SuppressWarnings("deprecation")
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// TODO Auto-generated method stub
Toast.makeText(this, "OnStartCommand()", Toast.LENGTH_SHORT).show();
NotificationManager notificationmanager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
Intent notificationintent = new Intent(this, Reminder_2.class);
PendingIntent pendingintent = PendingIntent.getActivity(this, 0, notificationintent, 0);
int icon=R.drawable.ic_launcher;
long when=System.currentTimeMillis();
@SuppressWarnings("deprecation")
Notification notification=new Notification (icon, "There's a message", when);
notification.setLatestEventInfo(this, "Title here", "Content here.", pendingintent);
notificationmanager.notify(033, notification);
return super.onStartCommand(intent, flags, startId);
}