long pattern[] = {50,100,100,100};
vibrator.vibrate(pattern, 2);
怎么停不下来了 一直在震动 2不就是只重复两次么 无语了

解决方案 »

  1.   

    是不是设置的flags的原因?还是?
      

  2.   

    是不是设置的flagsd的原因?还是?
      

  3.   

     void android.os.Vibrator.vibrate(long[] pattern, int repeat)
    Vibrate with a given pattern. Pass in an array of ints that are the times at which to turn on or off the vibrator. The first one is how long to wait before turning it on, and then after that it alternates. If you want to repeat, pass the index into the pattern at which to start the repeat.Parameters:
    pattern an array of longs of times to turn the vibrator on or off.
    repeat the index into pattern at which to repeat, or -1 if you don't want to repeat.
      

  4.   

    设定重复的次数:在pattern[]中增加on和off的时间数值对;