How to change programmatically a global setting like 'haptic feedback'?
<p>How can I change programmatically a global setting like 'haptic feedback'?<br>
(Manually you can change this setting in 'Sound &amp; Display Settings')</p>

<p>Changing e.g. the airplane mode can be done with the following code:</p>

<pre><code>private void setAirplaneMode(boolean bOn)
{
    Settings.System.putInt(getContentResolver(), 
                           Settings.System.AIRPLANE_MODE_ON, 
                           bOn ? 1 : 0); 

    Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
    intent.putExtra("state", bOn ? 1 : 0);
    sendBroadcast(intent);
}
</code></pre>

<p>However, for 'haptic feedback' this does not work because I don't find a corresponding intent.</p>

<p>Simply</p>

<pre><code>private void setHapticFeedbackMode(boolean bOn)
{
     Settings.System.putInt(getContentResolver(),
                            Settings.System.HAPTIC_FEEDBACK_ENABLED, 
                            bOn ? 1 : 0);
}
</code></pre>

<p>does not work (I guess a broadcast of an intent is really necessary).</p>

<p>I am not interested in things like <code>setHapticFeedbackEnabled</code>, because in that way you are only changing the way how the calling app/view is handling haptic feedback.
I am looking for a way to change the global setting. (Like if you were checking/unchecking the checkbox in 'Sound &amp; Display Settings' manually.)</p>
