Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 583
King Bufo Avatar asked Oct 12 '25 19:10

King Bufo


1 Answers

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

like image 116
Mehraban Avatar answered Oct 14 '25 13:10

Mehraban



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!