如何改变android应用程序的振动模式?

如何改变android应用程序的振动模式?,android,blackberry,android-vibration,vibration,bb-messenger,Android,Blackberry,Android Vibration,Vibration,Bb Messenger,我有根。我在手机上使用Blackberry Hub,但它在通知新邮件时震动太大。那么我该如何更改呢?要实际更改振动模式,您需要实现自定义代码,这意味着您需要使用diff-diff-seconds限制实现默认振动 if (IS_VIBRATE) { IS_VIBRATE = true; final Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

我有根。我在手机上使用Blackberry Hub,但它在通知新邮件时震动太大。那么我该如何更改呢?

要实际更改振动模式,您需要实现自定义代码,这意味着您需要使用diff-diff-seconds限制实现默认振动

if (IS_VIBRATE) {
            IS_VIBRATE = true;
            final Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
            if (v.hasVibrator()) {
                final long[] pattern = {0, 100, 500, 100, 500, 100, 500, 100, 500, 100};
                new Thread() {
                    @Override
                    public void run() {
                        for (int i = 0; i < 10; i++) {
                            v.vibrate(pattern, -1);
                            try {
                                Thread.sleep(3000);
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                        }
                    }
                }.start();
            }
        }
if(是否振动){
IS_振动=真;
最终可控震源v=(可控震源)getSystemService(Context.可控震源_服务);
if(v.has可控震源()){
最终长[]模式={0,100,500,100,500,100,500,100,500,100};
新线程(){
@凌驾
公开募捐{
对于(int i=0;i<10;i++){
v、 振动(模式-1);
试一试{
睡眠(3000);
}捕捉(中断异常e){
e、 printStackTrace();
}
}
}
}.start();
}
}
是的,确保AndroidManifest.xml文件中有