It builds fine with no errors but when I press the button thats used in the function, the app crashes. Ive narrowed the problem down to the
"resistorValue" is a string..
If i put a normal float value in here instead, it runs fine but once I try to extract the float it keeps crashing..Ive been at it a couple of hours now and just cant solve it..
Any ideas? Something simple no doubt..
Did you expect to convert that string into a float value in some way? I don't see a reasonable way of interpreting the string "resistorValue" as a float value.
On the other hand: is it possible that you have a String variable named "resistorValue" which contains a String to be interpreted as a float value? If that's the case then your code should look like this:
Whenever an app crashes, an exception stacktrace is written to the logcat. That contains the actual error message, and should be the first step when debugging app crashes. Post the full stacktrace here, and we'll try to make sense of it.
The Toast doesn't show the actual value being parsed, so doesn't help much. And of course it needs to be done before the parsing, so you'll know which value causes the crash. No statements are executed after the app crashes.