我使用下面给出的代码。它在android studio更新之前完美运行。我创建的旧项目也显示了通知。但在新项目中,它无法运作。有人可以帮忙吗?
notificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder builder=new NotificationCompat.Builder(MainActivity.this)
.setContentText("Stand Up and dance!!")
.setContentTitle("Stand Up")
.setSmallIcon(R.drawable.ic_stat_name);
notificationManager.notify(NOTIFICATION_ID,builder.build());