title: Playing sound effect (CLICK/NAVIGATION_RIGHT) for button clicks - Android
body: <p>I'm trying to use the <code>playSoundEffect ()</code> method to play a sound effect when a button is clicked, but so far its' proved very difficult for some reason.</p>
  
  <p>I have defined the following.</p>
  
  <pre><code>&lt;ImageButton android:id="@+id/Button_flip" android:layout_width="fill_parent"
  android:layout_height="wrap_content" android:text="FLIP!"
  android:src="@drawable/flip" android:soundEffectsEnabled="true"&gt;
  &lt;/ImageButton&gt;
  </code></pre>
  
  <p>Then,</p>
  
  <pre><code>button_flip.playSoundEffect(android.view.SoundEffectConstants.CLICK);
  </code></pre>
  
  <p>is called in onCreate() method. But I cannot seem to get it to sound when I click the button. What am I missing here? The documentation has nothing much to go on.</p>
  
  <p>Do I need to define/call in the onClick() method?</p>
  
  <p>Any help is appreciated.</p>