几年前我创建了一个应用程序,但是,我刚刚更新了Android Studios,因此,我的通知代码无法正常工作,因为Android并未在最新的SDK版本中使用此代码我尝试过使用Notification.Builder
与我的代码,但是,我收到一个错误,所以有人可以帮助我。无法解析符号(contentIntent)
我收到的错误是cannot Resolve symbol (contentIntent);
String ns = Context.NOTIFICATION_SERVICE;
mNotificationManager = (NotificationManager) getSystemService(ns);
Notification.Builder builder = new Notification.Builder(mContext)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("Fall Detector")
.setContentText("Running")
.setContentIntent(contentIntent);
builder.build();
Notification notification = builder.getNotification();
mNotificationManager.notify(1, notification);
可能重复[setLatestEventInfo无法解析](https://stackoverflow.com/questions/32450449/setlatesteventinfo-cannot-be-resolved) – Sufian
Sufian请你为我重写我的方法,因为我挣扎着。谢谢 – user8162255
当您尝试Notification.Builder时,您会收到哪些错误? (你写了“一些错误”) –