Android Bildirim Sesi | Netgez.com
SORU
4 NİSAN 2013, PERŞEMBE


Android Bildirim Sesi

Yeni NotificationCompat oluşturucu kullandım ve bir bildirim sesi yapmak için alamıyorum. Titreşim ve ışık yanıp söner. Android belgeleri ile yaptığım bir stil ayarlamak için diyor ki:

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

Ama ses yok?

Tam kodu:

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());  

CEVAP
6 NİSAN 2013, CUMARTESİ


Benim önceki kod eksik ne oldu:

Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
builder.setSound(alarmSound);

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Dellbear816

    Dellbear816

    4 Mart 2008
  • Rozetked | Обзоры

    Rozetked | Ð

    5 AÄžUSTOS 2011
  • steven johns

    steven johns

    11 Mart 2011