How can I get the context in a fragment?
I need to use my database whose constructor takes in the context, but getApplicationContext() and Fragmen
getApplicationContext()
Fragmen
You can use getActivity(), which returns the activity associated with a fragment. The activity is a context (since Activity extends Context).
fragment
context
Activity
Context