Salve, come si può aggiungere oltre al suono la vibrazione alla notifica?
Salve, come si può aggiungere oltre al suono la vibrazione alla notifica?
dico in questo caso:
.setVibrate cosa devo impostare?codice:NotificationCompat.Builder n = (NotificationCompat.Builder) new NotificationCompat.Builder(Main2Activity.this) .setContentTitle("Attenzione") .setContentText("OK") .setSmallIcon(android.R.drawable.ic_dialog_email) .setSound(sound);
Non me ne intendo di Android. Ma basta leggere il javadoc di setVibrate:
NotificationCompat.Builder setVibrate (long[] pattern)
Set the vibration pattern to use.
e poi c'è il link for a discussion of the pattern parameter.
Dove per i vibrate() spiega:
Pass in an array of ints that are the durations for which to turn on or off the vibrator in milliseconds. The first value indicates the number of milliseconds to wait before turning the vibrator on. The next value indicates the number of milliseconds for which to keep the vibrator on before turning it off. Subsequent values alternate between durations in milliseconds to turn the vibrator off or to turn the vibrator on.
Quindi quale è il dubbio ora?
Andrea, andbin.dev – Senior Java developer – SCJP 5 (91%) • SCWCD 5 (94%)
java.util.function Interfaces Cheat Sheet — Java Versions Cheat Sheet