Android Notification-builder Ton funktioniert nicht

Ich habe versucht, viele Dinge, die hier vorgeschlagen wird, aber nichts funktioniert für mich.
hier ist mein source code:

Intent resultIntent = new Intent(this, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, resultIntent,PendingIntent.FLAG_UPDATE_CURRENT);  
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("title")
.setContentText("Hello World!");
mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
mBuilder.setContentIntent(contentIntent);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(0, mBuilder.build());

Die Meldung erscheint, aber kein Ton, keine Hilfe ?

  • Ich habe das gleiche problem, bitte teilen, wenn du eine Lösung gefunden
  • mein problem war, weil ich geschrieben habe mBuilder.setDefaults(Notification.DEFAULT_ALL);. Diese Zeile machen mBuilder.setSound unwirksam .
InformationsquelleAutor AhlyM | 2013-07-03
Schreibe einen Kommentar