1
내 앱의 경우 사용자의 알림 메뉴가 복잡하지 않도록 알림 ID 하나를 사용합니다. 각 알림에는 티커 텍스트가 있습니다. 내 앱에서 알림이없고 사용자가 알림을 받으면 티커 텍스트가 표시됩니다. 알림이 이미 있고 업데이트 만되면 티커 텍스트가 표시되지 않습니다. 티커 텍스트를 다시 표시하려면 어떻게합니까?
는 내가 통지하기 전에 내가 통지를 취소 할 경우, 매우 해키 주위에 작품을 만들었지 만, 이것은 궁극적으로 진동이 매우 명백한 지연이 발생합니다.현재 어떻게 알림이 일어나고 있습니다 : 그것은 이전과 같은 경우
mBuilder.setSmallIcon(R.drawable.actionbar_logo)
.setContentTitle(extras.getString("title"))
.setContentText(extras.getString("summary"))
.setAutoCancel(true)
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(extras.getString("extended_text"))
)
.setLights(Color.WHITE, NOTIF_LIGHT_INTERVAL, NOTIF_LIGHT_INTERVAL)
.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE);
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra("mainActivityNotification", true);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent contentIntent = PendingIntent.getActivity(this, 424242, intent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(contentIntent);
final Notification notification = mBuilder.build();
notification.tickerText = extras.getString("title") + "\n" +
extras.getString("summary") + "\n" +
extras.getString("post_body");
mNotificationManager.notify(GATE_NOTIFICATION_ID, notification);
하지만, 사람이 질문에 대답 할 수 있도록 당신은 최소한의 관련 코드를 제공해야합니다 : 아래처럼
그래서, 당신의 전체 코드가 보인다. – ozbek부모를 업데이트했습니다. – David
답변을 보려면 http://stackoverflow.com/a/16435330/2841101을 방문하십시오. 다음번에 같은 빌더를 사용해야한다고합니다. 그리고 빌더를 사용하면 tickertext를 업데이트하면됩니다. –