-1
이것은 내가 android studio에서 쓴 것입니다. 작동하지 않습니다. 알림이 표시되지 않습니다.이 알림 코드가 작동하지 않는 이유는 무엇입니까?
NotificationManager notificationManager=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Intent i_mainActivity=new Intent(this,MainActivity.class);
PendingIntent p_mainActivity=PendingIntent.getActivity(this, 0, i_mainActivity, 0);
NotificationCompat.Builder notification_popup=new NotificationCompat.Builder(this)
.setContentTitle("An Alarm is going on")
.setContentText("Click to stop")
.setContentIntent(p_mainActivity)
.setAutoCancel(true);
int id=001;
notificationManager.notify(id,notification_popup.build());
"작동하지 않는다"는 의미를 설명하십시오. 당신의 증상은 무엇입니까? – CommonsWare