Android Java
[Android] - 안드로이드 Notification, 상태바 알림 사용예제
Vivara
2013. 8. 29. 17:30
반응형
private static Notification noti;
private static final int notiId = 1;
noti = new NotificationCompat.Builder(ncontext)
.setSmallIcon(R.drawable.btn_star)
.setContentTitle(title)
.setContentText(content)
.setTicker("알람이 동작되었습니다.")
.setContentIntent(pintent)
.setAutoCancel(false)
.build();
noti.flags |= Notification.FLAG_NO_CLEAR; // 지우기 버튼 눌렀을때 지워지지 않게
nm.notify(notiId, noti); // 알림 동작
nm.cancel(notiId); // 알림 제거
반응형