A
A
Albert Kazan2019-05-13 22:06:32
Kotlin
Albert Kazan, 2019-05-13 22:06:32

How to make a class available in all activities?

There are a couple of features that are needed on almost every page. And I don’t want to prescribe onclicklistener on each activity class (what if I have to change?!).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2019-05-13
@iLLuzor

Options are possible - implement methods in the base class and inherit from it, write extension functions, just write functions separately and use where necessary.
In general, little is known from the question. In the heading is the class, in the body of the function. What does the click listener have to do with it is also unclear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question