Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText vs TextView

I read the API's and see that TextView is a super class to EditText, but I have a short and simple question: Generally speaking, EditText is used when the text displayed is subject to change, whether it's from the user or the app. TextView is used when the text displayed is to be constant/same forever. Is this correct?

like image 850
user2927724 Avatar asked May 08 '14 02:05

user2927724


People also ask

What is EditText and TextView?

EditText is used for user input. TextView is used to display text and is not editable by the user. TextView can be updated programatically at any time.

What is edit TextView in android?

Advertisements. A EditText is an overlay over TextView that configures itself to be editable. It is the predefined subclass of TextView that includes rich editing capabilities.

What is the purpose of TextView?

A TextView displays text to the user and optionally allows them to edit it. A TextView is a complete text editor, however the basic class is configured to not allow editing.

Is EditText a subclass of TextView?

Android EditText is a subclass of TextView. EditText is used for entering and modifying text. While using EditText width, we must specify its input type in inputType property of EditText which configures the keyboard according to input.


1 Answers

EditText is used for user input.

TextView is used to display text and is not editable by the user. TextView can be updated programatically at any time.

like image 67
Garret Avatar answered Oct 04 '22 19:10

Garret