Reputation: 668
Trying to set a TextView, to a certain message containing a variable.
for Example
tvOddEven.setText("You have entered:", odd, "% of numbers");
odd is an int variable
it's giving me an error, that I can't use those parameters.
ideas?
Upvotes: 0
Views: 122
Reputation: 7708
Try this:
tvOddEven.setText("You have entered:" + String.valueOf(odd) + "% of numbers");
Since odd is not a String you need to convert it to string.
Upvotes: 1
Reputation: 73425
tvOddEven.setText("You have entered:" + odd + "% of numbers");
Upvotes: 5