홈>
https://material.io/guidelines/patterns/notifications에서. html # notifications-behavior , 실제로 알림을 표시하지 않고 사용자에게 알릴 수 있습니다.
팝업 알림을 보지 않고 상태 표시 줄에 깜박이는 즐겨 찾기 아이콘을 표시하고 싶습니다. ( https://material.io/ Guidelines/patterns/notifications.html # notifications-behavior , 상태 표시 줄에 깜박임이 표시됨)
상태 표시 줄에 깜박이는 아이콘 그러나, 나는 그것을 달성하는 방법을 완전히 확신하지 못한다. 사용자에게 알릴 때마다 알림 팝업이 표시됩니다. 알림 팝업 엿보기내 코드는 다음과 같습니다
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context.getApplicationContext(), org.yccheok.notification.Utils.createNotificationChannel())
.setContentIntent(pendingIntent)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle(contentTitle)
.setTicker(ticker)
.setColorized(true)
.setColor(context.getResources().getColor(R.color.accent_material_light))
.setContentText(contentText);
mBuilder.setSound(Uri.parse(getStockAlertSound()));
mBuilder.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE);
mBuilder.setAutoCancel(true);
// Need BIG view?
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
// Sets a title for the Inbox style big view
inboxStyle.setBigContentTitle(contentTitle);
inboxStyle.setSummaryText(summaryText);
for (SpannableString notificationMessage : notificationMessages) {
inboxStyle.addLine(notificationMessage);
}
mBuilder.setStyle(inboxStyle);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
앱이 포 그라운드에있을 때 알림 팝업을 피할 수 있지만 상태 표시 줄에 깜박이는 아이콘 만 표시하는 방법이 궁금합니다.
- 답변 # 1
관련 자료
- android - 포 그라운드 서비스에 대한 알림을 표시 할 수 없습니다
- codenameone - 앱이 포 그라운드에있을 때 푸시 알림에 도달하지 않음
- iOS Swift 5에서 앱이 포 그라운드에있는 동안 푸시 알림을받을 수있는 방법이 있습니까?
- android - Google Play 뮤직과 같은 포 그라운드 서비스 알림 (MediaStyle)을 유지하는 방법은 무엇입니까?
- flutter - 알림 플로팅 팝업 메뉴
- react native - Android 포 그라운드에 푸시 알림이 표시되지 않음
- xamarin.forms - Xamarin Forms Android의 화면에서 알림 팝업을 표시하는 방법은 무엇입니까?
- java - 앱이 포 그라운드에 있지 않더라도 imageView 팝업
- java - 앱에서 포 그라운드 서비스를 시작할 때 사용자가 설정에서 알림 권한을 끈 경우 포 그라운드에 서비스가 있습니까?
- android - 알림 UI 표시를 호출 할 때 프로그래밍 방식으로 포 그라운드 서비스 알림 '노이즈'를 중지하는 방법
- android - 포 그라운드 서비스 알림에서 버튼 제거
- android - 전경 앱 알림이 거의 비어 있으며 백그라운드 앱에 알림이 표시되지만 맞춤 데이터는 표시되지 않습니다
- Xamarin Android에서 백그라운드, 포 그라운드 및 닫힌 상태의 앱인 경우 sqlite에 Firebase 푸시 알림을 저장하는 방법
- android - 포 그라운드 서비스가 진행 중이 아닌 알림을 호출 할 수 있습니까 (api> 26)
- python - 전경을 추출 할 때 색상 누출을 피하는 방법은 무엇입니까?
- android - FCM 원격 알림, 아이콘이 포 그라운드에서 사용되지 않음
- java - 알림을 클릭 할 때 활동을 팝업 의도로 표시하는 방법은 무엇입니까?
트렌드
- OpenCv의 폴더에서 여러 이미지 읽기 (python)
- 파이썬 셀레늄 모든 "href"속성 가져 오기
- html - 자바 스크립트 - 클릭 후 변경 버튼 텍스트 변경
- git commit - 자식 - 로컬 커밋 된 파일에 대한 변경을 취소하는 방법
- JSP에 대한 클래스를 컴파일 할 수 없습니다
- javascript - 현재 URL에서 특정 div 만 새로 고침/새로 고침
- jquery - JavaScript로 현재 세션 값을 얻으시겠습니까?
- javascript - swiperjs에서 정지, 재생 버튼 추가
- JavaScript 변수를 HTML div에 '출력'하는 방법
- python - 문자열에서 특정 문자 제거