Android AppCompatTextView

| Page Views: 1519

AppCompatTextView is basically a TextView which provides support to older version of the android platform with compatible features of a TextView.

Whenever you use a TextView, android may automatically use the AppCompatTextView.

This is if your project has the necessary support library dependencies.

AppCompatTextView resides in the package.


This class derives from TextView:

public class AppCompatTextView extends TextView{}

Given that it derives from android.widget.TextView, this class inherits TextView's XML attributes. Some of these attributes are inherited by TextView itself from the base View class.

Creating AppCompatTextView.

Not only can you create AppCompatTextView via the XML specifications, but you can also create them programmatically.

To do so you can use the provided public constructors.

Android does provide us three of those:

No. Constructor
1. AppCompatTextView(Context context)
2. AppCompatTextView(Context context, AttributeSet attrs)
3. AppCompatTextView(Context context, AttributeSet attrs, int defStyleAttr)

As for the methods this class does inherit them from other classes like TextView, View and Object.

How do You Feel after reading this?

According to scientists, we humans have 8 primary innate emotions: joy, acceptance, fear, surprise, sadness, disgust, anger, and anticipation. Feel free to tell us how you feel about this article using these emotes or via the comment section. This feedback helps us gauge our progress.

Help me Grow.

I set myself some growth ambitions I desire to achieve by this year's end regarding this website and my youtube channel. Am halfway. Help me reach them by:


What do You Think

Previous Post Next Post