我正在使用Kotlin,并希望设置振动以进行通知。该.setVibrate()功能需要一个,LongArray但我不能为其定义。
var Builder = NotificationCompat.Builder(this,R.string.channel_name.toString())
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("my notification Title")
.setContentText("somthing else for content")
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setAutoCancel(true)
.setVibrate(LONG_ARRAY)
Run Code Online (Sandbox Code Playgroud)
我在网上搜索,但只是找到Java解决方案。感谢您的帮助。