Skip to content

Commit

Permalink
notification sound added
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvir-ahmod committed May 7, 2017
1 parent 2afeb90 commit 9ef66f9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.IBinder;
import android.util.Log;

Expand Down Expand Up @@ -81,9 +83,14 @@ private void showNotification(String message1, String messege2) {
Intent intnt = new Intent(RoutineService.this, ViewNotification.class);

PendingIntent pIntent = PendingIntent.getActivity(RoutineService.this, 0, intnt, 0);

Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);


Notification n = new Notification.Builder(RoutineService.this)
.setContentTitle(message1).setContentText(messege2)
.setContentIntent(pIntent).setSmallIcon(R.drawable.addnotification)
.setSound(soundUri)
.build();

NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Expand Down

0 comments on commit 9ef66f9

Please sign in to comment.