Ciao ho un problema molto antipatico:
ho inserito in un' app una seekbar per selezionare i numeri di input
gestendola come da esempio:
codice:
/* sb_fatturato.setOnSeekBarChangeListener(
new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
int step = 1000;
int max = 200000;
int min = 10000;
seekBar.setMax((max - min) / step);
// Ex :
// And finnaly when you want to retrieve the value in the range you
// wanted in the first place -> [3-5]
//
// if progress = 13 -> value = 3 + (13 * 0.1) = 4.3
double value = min + (progress * step);
Fatturaton.setText(String.valueOf(value));
}
}
);*/
con questo codice riesco a visualizzare nelle EditText il valore selezionato ma quando lo vado a leggere per farci delle operazioni in questa maniera:
codice:
Fatturato=0;
Fatturaton.getText().toString().trim().length() > 0) {
String Fatturatos = Fatturaton.getText().toString().trim();
Fatturato = Integer.parseInt(Fatturatos);
l'app crasha come se non ci fosse un int ma un carattere.
eliminando le seekbar funziona tutto.
qualcuno ha idee?esperienze?consigli?