I have two variables. I need to show these variables addition and also add some text in textView.
Example
val a val b
The text i needed "Addition is (a+b)"
Sorry if i've done any mistake, I'm a newbie.
val a =...
val b =...
val textView =...
In Kotlin you can use interpolation so
textView.text = "Addition is ($a+$b)"
the Android way of doing so is using the strings.xml
<string name="addition">Addition is (%1d+%2d)</string>
And then
textView.text = resources.getString(R.string.addition, a, b)
int c=a+b;
String textNeeded="Addition is "+c;
textView.setText(textNeeded);