List of usage examples for android.view View setSoundEffectsEnabled
public void setSoundEffectsEnabled(boolean soundEffectsEnabled)
From source file:com.github.kimikage.uguisuan.MainActivity.java
private void setPlayAndPauseButton() { Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar == null) { return;//from www.jav a 2 s . com } if (toolbar.getMenu() == null) { return; } boolean playing = isPlaying(); MenuItem menuItem = (MenuItem) toolbar.getMenu().findItem(R.id.action_play_pause); menuItem.setTitle(getResources().getString(playing ? R.string.action_pause : R.string.action_play)); menuItem.setIcon(playing ? R.drawable.ic_pause_circle_filled_white_48dp : R.drawable.ic_play_circle_filled_white_48dp); View v = findViewById(R.id.action_play_pause); if (v != null) { v.setSoundEffectsEnabled(playing); } }