M
M
max_vr2016-07-24 00:48:09
Android
max_vr, 2016-07-24 00:48:09

How to apply a non-static fragment method from another class?

I'm new to android programming.
Actually, the problem is this:
There is a class inherited from a fragment, it has a non-static method. How to call this method from another class?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2016-07-24
@GavriKos

Get a pointer to a fragment instance in this other class and call this method on the instance.
The pointer can be obtained in very different ways - it all depends on your architecture. From which thread findViewByID, to the singleton.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question