How to display the value of a variable on the screen?

前端 未结 5 758
别那么骄傲
别那么骄傲 2021-01-03 23:20

I know this is very basic question, but I need to know, how I can display the contents of a variable on the screen.

Do I use a textview in my layout?

I have

5条回答
  •  孤街浪徒
    2021-01-03 23:47

    int count=7;
         TextView tv = (TextView) findViewById(R.id.my_text_view);
    tv.setText("you have entered"+count+"as the integer");
    

    As you can see,you can include other data types like integers also in the setText block

提交回复
热议问题