i have twenty different activities with the same MaterialTextView (same name in all activities)
in all activities (in the onCreate event), i initialize the textview with the same text:
textview.text = "Hello"
each activity has a different binding XML, like ActivityOneBinding, ActivityTwoBinding, ActivitythreeBinding, and so on
i need to reduce the "repeated code" in all activites with the creation of an actract class to inherit, and set the text in there one time
I have tried examples of abstract class to inherit, but the name of the textview does not recognize because they are different bindings
Instead of passing view name, you can pass reference to TextView object. In this example such function is
getHeaderView()
:BaseActivity.kt