Considering the main purpose of a button is to react to a click event, and the fact that both Button
and TextView
has properties for text, drawable (icon) and click event, what is the actual difference between them, when should you chose one over the other?
Looking at the reference docs, the Button class extends the TextView class. From there, the Button adds a few stylistic changes (e.g., default background image, additional padding) to allow quicker adaptation to your designs.
IMO, the one you choose to use should depend on how you want to design your app. If you use the default theme with minimal stylistic changes, Buttons can be quicker to visualize; on the other hand, if you are doing a lot of customization, TextView will let you do that much easier.
**Edit: ** GrepCode shows that from a functionality point of view, there is no difference aside from class name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With