jeudi 17 décembre 2020

Comparing Textview data in android studio

What I am trying to do is that I have a data in textview which will then be passed to a if statement. I am trying to convert the string into int but it's not working.

 result = scoreTextview.getText().toString();

        if(Integer.parseInt(result) == 10) {

            result_meaning.setText("Congrats you got a perfect score of 10");

        }

Aucun commentaire:

Enregistrer un commentaire