سؤال

I'm hoping not, but just wanted to get a definitive answer since its not stated in the docs. Do I have to check with Vibrate.hasVibrator before vibrating?

هل كانت مفيدة؟

المحلول

According to the source code of android.os.Vibrator, vibrate() will not throw anything:

public void vibrate(long milliseconds)
{
    try {
        mService.vibrate(milliseconds, mToken);
    } catch (RemoteException e) {
    }
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top