Why is VIBRATOR_SERVICE not working consistently?

I have 2 phones, one on Android 4.1.1 and the other on Android 4.1.2.

On an Android 4.1.1 phone, the vibration intensity depends on the Haptic Feedback level, while the 4.1.2 phone vibration is strong and does not depend on this Haptic Feedback level at all.

I tried to find a way to get around this, but I just don't get it. I really don't want the vibration intensity to depend on Haptic Feedback, because some users don't like enabling this Haptic Feedback.

Can someone explain this?

Here is the code:

 import android.os.Vibrator;
 ...
 Vibrator v = (Vibrator) this.context.getSystemService(Context.VIBRATOR_SERVICE);
 // Vibrate for 500 milliseconds
 v.vibrate(500);

      

manifest:

<uses-permission android:name="android.permission.VIBRATE"/>

      

Thank you so much

+3


source to share


1 answer


Vibrator v = (Vibrator)getApplicationContext().getSystemService(getApplicationContext().VIBRATOR_SERVICE);

      



+1


source







All Articles