Android通知振动问题
我似乎无法使用set.Vibrate更改振动的模式/长度。我的代码如下:Android通知振动问题,android,Android,我似乎无法使用set.Vibrate更改振动的模式/长度。我的代码如下: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this, "expired") .setSmallIcon(R.drawable.emptylove_icon) .setColor(getResources().getColor(R.color.colorPr
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this, "expired")
.setSmallIcon(R.drawable.emptylove_icon)
.setColor(getResources().getColor(R.color.colorPrimary))
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher_round))
.setContentTitle(getString(R.string.notification_expired_title))
.setContentText(notestring + getString(R.string.notification_expired_text))
.setPriority(NotificationCompat.PRIORITY_MAX)
.setLights(Color.RED, 3000, 3000)
.setVibrate(new long[] { 1000, 1000, 1000, 1000})
.setAutoCancel(true);
这成功地提供了具有正确图标、颜色的通知,并且有一个简单的短振动
但是,任何
setVibrate(new long[] { 1000, 2000, 1000, 2000})
无论我输入什么值,结果都是相同的振动。无论我做什么,振动都保持不变。我在这里遗漏了什么吗?你能试着只给出两个参数,比如setVimble(新长[]{1000,1000})?@PrashanthVerma我试过setVimble(新长[]{1000,1000})和setVimble(新长[]{5000,5000}),但都产生了相同的默认振动。就像它在振动一样