Skip to content
Snippets Groups Projects
Commit 78b802b8 authored by Massimiliano's avatar Massimiliano
Browse files

Light + vibration added for notification

parent dce235fd
Branches
Tags
No related merge requests found
...@@ -1942,7 +1942,9 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL ...@@ -1942,7 +1942,9 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
.setContentInfo(message)//get text message from json :-) .setContentInfo(message)//get text message from json :-)
.setContentIntent(launchStateMessages); .setContentIntent(launchStateMessages);
Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
mBuilder.setSound(alarmSound); mBuilder.setSound(alarmSound)
.setVibrate(new long[]{50,500,100,300,50,300})
.setLights(Color.MAGENTA, 3000, 3000);
NotificationManager mNotificationManager = NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(001, mBuilder.build()); mNotificationManager.notify(001, mBuilder.build());
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment