每次我触摸它时,我都想从我的应用程序中的 seekbar 中获得价值。我在 seekbar 中声明的值将添加到我的 url 但每次我触摸 seekbar 时它都会给我一个循环,并且 url 将循环并加载为数量 seekbar on progressChanged
。这是我的代码:
int period = 0;
SeekTime.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
// TODO Auto-generated method stub
if (SeekTime.getProgress() <= 3){
SeekTime.setProgress(0);
period=7;
}
if (SeekTime.getProgress() > 3 && SeekTime.getProgress() <= 8) {
SeekTime.setProgress(5);
period =30;
}
if (SeekTime.getProgress() >8 && SeekTime.getProgress()<=13){
SeekTime.setProgress(10);
period = 90;
}
if (SeekTime.getProgress() >13 && SeekTime.getProgress()<=18){
SeekTime.setProgress(15);
period = 180;
}
if (SeekTime.getProgress() >18 && SeekTime.getProgress()<=23){
SeekTime.setProgress(20);
period = 270;
}
if (SeekTime.getProgress() >23){
SeekTime.setProgress(25);
period = 360;
}
new LoadData(URL+period).execute();