Sorry about what is likely a noob question. I am working on a simple android app that involves a seekbar.
The app runs, however, when I release the seekBar it causes my app to crash.
Im trying to set a textview when the seekbar is released, but instead of setting the textview, the app crashes.
I believe this is my issue. When I comment it out, I can drag the seekbar with no issues.
progressTextView.setText(progressChangedValue) ;
XML CODE
<SeekBar
android:id="@+id/seekBar"
android:layout_width="329dp"
android:layout_height="32dp"
android:layout_marginStart="29dp"
android:layout_marginLeft="29dp"
android:layout_marginEnd="26dp"
android:layout_marginRight="26dp"
android:layout_marginBottom="52dp"
android:max="1000"
android:progress="500" />
JAVA
SeekBar seeker = (SeekBar) findViewById(R.id.seekBar) ;
progressTextView = (TextView)findViewById(R.id.seekBarLabel);
seeker.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
int progressChangedValue = 0;
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
progressChangedValue = progress;
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
progressTextView.setText(progressChangedValue) ;
}
});