getActivity

open fun getActivity(context: Context): Activity

Returns the Activity given a Context or null if there is no Activity, taking into account the potential hierarchy of ContextWrappers.