title: Vibrate device on long button press
body: <p>I want the device to vibrate as long as the user clicks the button. If the user press the button for a long period of time the device is to vibrate as long as the user clicks and holds. here is what I implemented but it works for a particular period of time.</p>
  
  <pre><code>final Button button = (Button) findViewById(R.id.button1);
  
  button.setOnLongClickListener(new OnLongClickListener() {   
  
      @Override
      public boolean onLongClick(View v) {
          if(v==button){
              Vibrator vb = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
              vb.vibrate(1000);
         }                
         return false;
      }
  });
  </code></pre>