I would like to show the value of a variable in a TextView, like the echo in php ..
I’ll explain .. I have a variable called “contadorRegistros“, which stores the number of records of the app .. I want to show in a TextView which the value of it …
In php I would do it:
<php
echo "this is my variable $contadorRegistros"
?>
How to do it on android?
And sorry for my english … I’m brazilian ..
Edit:
I can show a text, using the code:
TextView t = (TextView) findViewById (R.id.tvCont);
t.setText ("Test");
But when I switch “Test” by the variable I want, it does not work:
TextView t = (TextView) findViewById (R.id.tvCont);
t.setText (contadorRegistros);
What can I do for work? =/
If your variable is a int then doing something like this would help,