https://kotlinlang.org logo
m

mohamadreza jafarzade

08/26/2020, 9:58 PM
I have two fragments. Fragment A implements a listener. when I want to open fragment B, I set this listener directly in it and hold it as a lateinit var. Here is my problem. when i rotate screen in fragment B, I get error that I havent initialize the lateinit variable. How can i solve this?
i

Ian Lake

08/27/2020, 3:10 AM
m

mohamadreza jafarzade

08/28/2020, 8:37 AM
Thanks, I hope it will work.
6 Views