示例#1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    setContentView(R.layout.equalizer_main);
    if (null == getEqualizer() || null == getVirtualizer() || null == getBassBoost()) finish();
    startService(new Intent(this, MyService.class));
    prefs = getPreferences(MODE_PRIVATE);

    initApp();

    initEqualizer();

    if (Utils.isOn) {
      enableAll();
    } else {
      disableAll();

      onOffBtn.setImageResource(R.drawable.off_btn);
      Utils.isOn = false;

      Log.e("eqActive", Boolean.toString(equalizer.getEnabled()));
      dontTouch.setVisibility(View.VISIBLE);
      equalizer.setEnabled(false);

      equalizer.release();
      bassBoost.release();
      virtualizer.release();
      disableAll();
    }
    super.onCreate(savedInstanceState);
  }
示例#2
0
 public static void releaseEqualizer() {
   if (mEqualizer != null) {
     mEqualizer.release();
   }
   if (mBoost != null) {
     mBoost.release();
   }
 }