Android Son De Notification

J'ai utilisé le plus récent NotificationCompat builder et je ne peux pas obtenir la notification pour faire du bruit. Il se met à vibrer et le flash de la lumière. La android la documentation indique définir un style que j'ai fait avec:

  builder.setStyle(new NotificationCompat.InboxStyle());

Mais pas de son?

Le code complet:

NotificationCompat.Builder builder =  
        new NotificationCompat.Builder(this)  
        .setSmallIcon(R.drawable.ic_launcher)  
        .setContentTitle("Notifications Example")  
        .setContentText("This is a test notification");  


Intent notificationIntent = new Intent(this, MenuScreen.class);  

PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent,   
        PendingIntent.FLAG_UPDATE_CURRENT);  

builder.setContentIntent(contentIntent);  
builder.setAutoCancel(true);
builder.setLights(Color.BLUE, 500, 500);
long[] pattern = {500,500,500,500,500,500,500,500,500};
builder.setVibrate(pattern);
builder.setStyle(new NotificationCompat.InboxStyle());
//Add as notification  
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);  
manager.notify(1, builder.build());  
  • générateur de rapports.setSound(Paramètres.Système.DEFAULT_NOTIFICATION_URI) devrait également fonctionner
InformationsquelleAutor James MV | 2013-04-04