You now have 2 search bars with the following identifiers:
1) barheures - his id: R.id.barheures 2) barminutes - his id: R.id.barminutes
Now in the onProgressChanged method (SeekBar, int progress, boolean fromUser) do the following:
@Override public void onProgressChanged(SeekBar bar, int progress, boolean fromUser) { // TODO Auto-generated method stub Log.v("", "" + bar); switch (bar.getId()) { case R.id.barheures: textHours.setText("" + progress + "Heure(s)"); break; case R.id.barminutes: textMinutes.setText("" + progress + "Minute(s)"); break; } }
source share