user3265784
user3265784

Reputation:

Create Instance of TextView

I am new to the android eclipse and I have a very small question. I use a Text View and a Text Field in my application. TextView just says "Enter a number below". Then, I am going to make a button so that if the user clicks on it, it makes some things given the inserted value of the textfield. Question is, do I have to say TextView mytextview = (TextView)findViewById(R.id.tview); on my Main Activity to create an instance of it? Because, there is no data in it unlike Text Field, it just exists. Thanks a lot

Upvotes: 1

Views: 443

Answers (1)

AggieDev
AggieDev

Reputation: 5045

There is no need to do that if you don't need to interact with the TextView itself, getting a reference to the TextView is only used if you need to manipulate it in some way or get data from it.

Upvotes: 2

Related Questions