, , , , . , - , .
View.playSoundEffect () did not work on my device if it was not called from the UI thread. (I don't see this limitation described in the Android literature, so it may differ from device to device or from OS version to OS version.) View.performHapticFeedback () does not seem to care. I called both from ThreadPool thread; haptic feedback and sound effects did not.
I fixed this by placing a sound effect call to run in the user interface thread as follows:
getActivity().runOnUiThread(new Runnable()
{
@Override
public void run()
{
mSketchView.playSoundEffect(SoundEffectConstants.CLICK);
}
});
source
share