Android 中建议的通知振动持续时间是多少? 这是我当前的代码,它使通知振动 1000 毫秒
notificationBuilder.setVibrate(new long[] {0,1000});
是否有类似 notificationBuilder.setVibrate("default_time");
最佳答案
可以使用默认值,如下 -
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this);
Notification note = mBuilder.build();
note.defaults |= Notification.DEFAULT_VIBRATE;
note.defaults |= Notification.DEFAULT_SOUND;
或者你也可以这样做
mBuilder.setDefaults(DEFAULT_SOUND | DEFAULT_VIBRATE | DEFAULT_LIGHTS);
关于java - 建议的通知振动持续时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45635201/