I'm trying to multiply the value of my chronometer or just try to get the value to be a string.
Every time I try to make it a string and use toast.show()
to view it, my application crashes. I can get the value of my EditText
to show up but I can't seem to get my chronometer to work. Both the strings time
and fin
make it crash. Here's the code:
String hour = String.valueOf(mText.getText());
String time = String.valueOf(mChronometer.getBase() - stoppedMilliseconds);
int h = java.lang.Integer.parseInt(hour) / 60;
int t = java.lang.Integer.parseInt(time) * 1000 / 60;
int mm = h * t;
mon.setText(Integer.toString(mm));
String fin = "" + mm;
Toast.makeText(PoopActivity.this,
"Money made: " + fin, Toast.LENGTH_LONG).show();