Sunday, 29 November 2020

When is a fragment not attatched to an activity but only a context?

At the docs for Fragment.getActivity() it says: Return the FragmentActivity this fragment is currently associated with. May return null if the fragment is associated with a Context instead.

But how can a fragment not be associated with an activity? I mean, don't I always need an activity to show anything in Android?



from When is a fragment not attatched to an activity but only a context?

No comments:

Post a Comment