Skip to content

Difference between CustomTextView as Parent and Textview as Parent

i created CustomTextview as below

public class CustomTextView extends AppCompatTextView {
        public CustomTextView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
       // im changing font family here .ttf files



what is the difference between


CustomTextView textView = findViewbyId(;

and this

TextView textView = findViewbyId(;

When i put this TextView textView = findViewbyId(; IDE runs without throwing error. Why? Thanks!


A real life comparison:

When you learn to drive a manual transmission car, you can drive almost any manual transmission car. Imagine how bad it would be if you had to learn to drive every different model of car you encounter.

Source (+)