2014-10-22 3 views
2

다른 알림이 표시 될 때 알림 LED가 켜지도록 앱을 개발 중입니다. 모든 것이 L 아래의 Android 버전에서 작동하지만 L에서는 내 알림이 깜박 거리지 않고 대신 알림의 우선 순위가 MAX이고 다른 알림이 HIGH 일 때도 원래 알림이 계속 깜박입니다.Android L 알림 우선

제발 좀 도와 주실 수 있습니까? 감사합니다

Notification.Builder builder = new Notification.Builder(getApplicationContext()); 
builder.setContentTitle(String.format("%s found.", rule.getPattern())); 
builder.setSmallIcon(R.drawable.ic_stat_small); 
builder.setLights(rule.getColor(), 200, 100); 
builder.setPriority(Notification.PRIORITY_MAX); 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.L) { 
    builder.setCategory(Notification.CATEGORY_MESSAGE); 
} 
if (preferences.vibration().get()) { 
    builder.setVibrate(new long[]{0, 500, 500, 200, 500}); 
} 
notificationManager.notify((int) (long) rule.getId(), builder.build()); 

답변

0

당신이 설명하는 문제는 안드로이드 5.0의 버그이었고, 지금 안드로이드 5.1에 고정되어 있습니다. 귀하의 코드가 내게 맞는 것 같아서 5.1에서 예상대로 작동해야합니다.

+0

감사합니다. 업데이트 후 내 앱을 사용해 본 결과 작동했습니다. –