I am working on a settings Activity, and I need to enable or disable vibration/tone. I need to learn how to do these two functionalities in my app. I am also providing a snapshot of the setting Activity. I have tried this code for vibration but I do not know how to use this code in check box.
Vibrator vib = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
vib.vibrate(500);
Toast.makeText(this, "vib started", Toast.LENGTH_LONG).show();