Android TextView Control

Android TextView Control

Android TextView Control is a control that shows text to the user. If you want to show a text view for editor, use EditText, which is a subclass of TextView.  It doesn’t allow editing, but it’s subclass EditText provide editing options.

Usage

It is used to show the text view like a label. Let’s say you want to add a label on your app, i.e. Our new features, then you can add it with TextView.

Example

Now, we will write the code xml file, which has a TextView and EditText. Follow the below code,

activity_main.xml

For src\main\res\layout\activity_main.xml,

AndroidManifest.xml

The content of \src\main\AndroidManifest.xml, provides key information of your app to the system. The system needs this to run your code,

strings.xml
Here’s the code for res/values/strings.xml. The app name and any hardcoded strings will be visible,

Output

It shows our TextView, which shows the following text at the top: Working on an example Android app

We will also see an EditText, where user can enter value i.e. name,

Android TextView Output

Android EditText Control
Android Button Control
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment