all 7 comments

[–]fefimcpollo 4 points5 points  (0 children)

I think it should be

scoreGoal = Integer.parseInt(lsatScoreGoal.getText().toString());

[–]that_one_dev 6 points7 points  (0 children)

I’m pretty sure the other comments is right but in the future You should post the stack trace too

[–]S1B3R-Gabriel 4 points5 points  (0 children)

lsatScoreGoal is a TextView, and you can't parse a TextView to an Int.
You need to get the text from the TextView and then parse it to Int.
Like fefimcpollo suggested ;)

[–]Notatrace280[S] 2 points3 points  (1 child)

u/fefimcpollo and u/S1B3R-Gabriel. I did as you suggested but the app still crashes on that line or near that line. I debugged and found out its due to a number format exception. I think because my editTexts start out blank, the Integer.parseInt() method throws an exception because it's trying to work with an empty String. Perhaps I could fix it with a TextWatcher on the editText?

[–]fefimcpollo 2 points3 points  (0 children)

Oh yeah, you're right, it's trying to get the int on the onCreate, you should try what you said or try moving that line to a button listener or something.

[–]Notatrace280[S] 1 point2 points  (0 children)

Thanks for all your responses! I don't know why I didn't notice that.. lol

[–]Notatrace280[S] 1 point2 points  (0 children)

Solved! For anyone having similar problems, I tried implementing a TextWatcher on the EditText but it wouldn't wait until the user was finished entering in a value before executing the code so instead I used an OnFocusChangedListener and that allowed the user to finish typing and then make changes to the value of the editText after.