안드로이드 개발 질문/답변
(글 수 45,052)
제가 브로드캐스트 리시버에서 노티피케이션을 부르려고 하는데요.
public void onReceive(Context context, Intent intent) {
...생략
NotificationManager nm = (NotificationManager)context.getSystemService(context.NOTIFICATION_SERVICE);
PendingIntent pending = PendingIntent.getActivity(
context, 0,
new Intent(context, ScmMonitoringMenuActivity.class), 0);
// Create Notification Object
Notification notification =
new Notification(android.R.drawable.ic_input_add,
"SCM MESSAGE", System.currentTimeMillis());
notification.setLatestEventInfo(context,
"SCM MESSAGE", "SCM MESSAGE", pending);
nm.notify(1234, notification);
}
이런식으로 context를 이용해서 노티피케이션을 호출하려고했는데 SMS 노티피케이션과 겹쳐서 생기는 문제인지는 모르겟지만,
노티피케이션이 호출되지않습니다.
같은소스를 context만 this로 바꾸어서 액티비티에서는 잘동작하는데 말이죠.
어떤문제인지 고수님들 부탁드려요~~
public void onReceive(Context context, Intent intent) {
...생략
NotificationManager nm = (NotificationManager)context.getSystemService(context.NOTIFICATION_SERVICE);
PendingIntent pending = PendingIntent.getActivity(
context, 0,
new Intent(context, ScmMonitoringMenuActivity.class), 0);
// Create Notification Object
Notification notification =
new Notification(android.R.drawable.ic_input_add,
"SCM MESSAGE", System.currentTimeMillis());
notification.setLatestEventInfo(context,
"SCM MESSAGE", "SCM MESSAGE", pending);
nm.notify(1234, notification);
}
이런식으로 context를 이용해서 노티피케이션을 호출하려고했는데 SMS 노티피케이션과 겹쳐서 생기는 문제인지는 모르겟지만,
노티피케이션이 호출되지않습니다.
같은소스를 context만 this로 바꾸어서 액티비티에서는 잘동작하는데 말이죠.
어떤문제인지 고수님들 부탁드려요~~