我试图改变当前的预设但不知何故我失败了。我能够使用所有预设名称制作spinner
。但是当我尝试仅应用它们时,第一次seekbar
(60HZ)变化(声音听起来并不像应用了正确的预设)
equalizerPresetSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
m_equalizer.usePreset((short)position);
short numberFrequencyBands = m_equalizer.getNumberOfBands();
final short lowerEqualizerBandLevel = m_equalizer.getBandLevelRange()[0];
for(short i=0;i<numberFrequencyBands;i++)
{
SeekBar seekbar = (SeekBar)findViewById(i);
seekbar.setProgress(m_equalizer.getBandLevel(i)-lowerEqualizerBandLevel);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
是的...... Seekbar
的ID是0,1,2等等,因为我建立了动态