From 7f778403863b33a9460df9cfbc20114af755a237 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 2 May 2014 21:48:30 -0700 Subject: Possible fix for EQ crash some users are getting --- .../daneren2005/dsub/fragments/EqualizerFragment.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/github') diff --git a/src/github/daneren2005/dsub/fragments/EqualizerFragment.java b/src/github/daneren2005/dsub/fragments/EqualizerFragment.java index 4bdb1716..17448516 100644 --- a/src/github/daneren2005/dsub/fragments/EqualizerFragment.java +++ b/src/github/daneren2005/dsub/fragments/EqualizerFragment.java @@ -156,8 +156,18 @@ public class EqualizerFragment extends SubsonicFragment { SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(Constants.PREFERENCES_EQUALIZER_ON, enabled); editor.commit(); - equalizer.setEnabled(enabled); - updateBars(true); + for(int i = 0; i < 10; i++) { + try { + equalizer.setEnabled(enabled); + updateBars(true); + i = 10; + } catch (UnsupportedOperationException e) { + equalizerController.release(); + equalizer = equalizerController.getEqualizer(); + bass = equalizerController.getBassBoost(); + loudnessEnhancer = equalizerController.getLoudnessEnhancerController(); + } + } } private void updateBars(boolean changedEnabled) { -- cgit v1.2.3