2012-10-23 4 views
0

JB 알림을 만들려고하는데 표시 할 수 없으며 logcat에 오류가 발생하지 않습니다. 아무 것도하지 않습니다.Jelly Bean의 알림이 표시되지 않습니다.

내가 통지를 만드는 데 사용하고 코드는 다음과 같다

private void bigPictureNotification(){ 

    Notification.Builder builder; 
    Notification notification; 
    NotificationManager manager; 

    Intent intent = new Intent(this, NotificationPendingIntent.class); 
    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); 

    //carica l'immagine 
    Bitmap icon = BitmapFactory.decodeResource(getApplicationContext().getResources(), R.drawable.androidworld); 

    builder = new Notification.Builder(getApplicationContext()); 
    builder.setContentTitle("Titolo piccolo"); 
    builder.setContentText("Testo della notifica"); 
    builder.setSmallIcon(R.drawable.ic_stat_notifica); 
    builder.setLargeIcon(icon); 
    builder.addAction(R.drawable.ic_action_search, "Cerca", pendingIntent); 
    builder.addAction(R.drawable.ic_stat_notifica, "AndroidWorld", pendingIntent); 
    builder.addAction(R.drawable.ic_launcher, "Launcher", pendingIntent); 
    builder.build(); 

    notification = new Notification.BigPictureStyle(builder).bigPicture(icon).build(); 
    //notification = builder.build(); 
    notification.flags = Notification.FLAG_AUTO_CANCEL; 

    manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); 
    manager.notify(0, notification); 

} 

실수는 어디에 있습니까? 도움

+0

한 번 확인 : http://www.droid-life.com/2012/08/28/how-to-disable-application-notifications-in-jelly-bean-beginners-guide/ –

+0

귀하의 휴대 전화에서 알림 –

+0

아니, 첫 번째로 밖으로 테스트했지만, 그들이 게재됩니다 – tiwiz

답변

0

시험 후 builder.setContentIntent(pendingIntent); 내가

0

난 그냥

notification = ... 
전에

builder.build() 

에 전화를 제거 거라고 인치 넣어 후에 나를 위해 일한 builder.build(); 전에 추가에 대한 감사합니다

으로 builder.build()는 알림 객체를 제공합니다. 그 총을 줘.

관련 문제