Q:

How do i get Activity instead of FragmentActivty?

getActivity (kotlin: activity) inside a fragment gives me FragmentActivity. But now i need Activity instead of FragmentActivity for a specific listener and its not possible to cast it to Activity.

A:

for any one else may have this problem.
just add !!
(activity!!)

A:

The FragmentActivity class extends the Activity class.
So if anything requires an Activity, you can always simply pass in a reference to a FragmentActivity.
If your code still does not work, then this is not the issue. If so, you'll need to post some more information for us to be able to help you.

