/**
* Sets the click listener of the passed in View to launch the HTC Sound Enhancer if possible.
*
* @param enhanceSoundButton View to set click listener on
* @return true if the click listener was set
*/
private boolean setHtcSoundEnhancerOnClick(final View enhanceSoundButton) {
final Intent enhanceSoundIntent = new Intent(
'com.htc.HtcSoundEnhancerSetting.ShowSettingPage');
// Check if API is supported.
final List<ResolveInfo> activities = getPackageManager()
.queryIntentActivities(enhanceSoundIntent, NO_FLAGS);
if (activities.isEmpty()) {
return false;
}
// Call it on click.
enhanceSoundButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View view) {
startActivity(enhanceSoundIntent);
}
});
return true;
}