Why does Android select AppCompat components when I don't declare them explicitly?

Viewed 770

I was debugging my App and found while hovering on an ImageView reference that, it is an AppCompatImageView instead of an ImageView. The same happened with a TextView(with AppCompatTextView).

enter image description here

While I don't particularly have a problem with this behavior because its AppCompat after all but when inspecting the code of fellow developers, I saw, extends Activity instead of AppCompatActivity and I almost marked it as a "bad practice".

On the other hand, while working on vector images, I was using an ImageView and there was a problem because I hadn't used an AppCompatImageView and using it was the solution:

ImageView not displaying correctly in the device

This inconsistent behavior has really confused me as to the practices I should follow. Should I just extend from an Activity from now on?

3 Answers
Related