Im building an Android application in eclipse and i get the error:
constructor Vibrator() is not visible
I have no clue how to solve this issue can you help? Here is the section of the code:
@Override
public void onCreate() {
mVibrator = new Vibrator();
// Listen for incoming calls to kill the alarm.
mTelephonyManager =
(TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
mTelephonyManager.listen(
mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);
AlarmAlertWakeLock.acquireCpuWakeLock(this);
}
You are not supposed to create a new Vibrator instance (therefore the constructor is invisible to you), you should rather get an existing one from the system:
mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With