Android qml app play notification sound

This commit is contained in:
Gioacchino Mazzurco 2017-05-02 12:20:27 +02:00
parent 3fddbaf070
commit fcca44d1e6

View File

@ -23,6 +23,7 @@ import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import org.qtproject.qt5.android.bindings.QtService;
@ -36,7 +37,8 @@ public class RetroShareAndroidNotifyService extends QtService
mBuilder.setSmallIcon(R.drawable.retroshare06_48x48)
.setContentTitle(title)
.setContentText(text)
.setAutoCancel(true);
.setAutoCancel(true)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
Intent intent = new Intent(this, RetroShareQmlActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);