Open AnuragThePathak opened 3 years ago
@AnuragThePathak i got this, assign to me
Done.
I'm interested in the discussion as well. Want to learn where I went wrong
I'm interested in the discussion as well. Want to learn where I went wrong
You went wrong means?
Using the Leak Canary library, I found there were some memory leaks in the app. But I was unable to fix them, so I mentioned that if in my newly added code, if there is anything wrong that is causing memory leak, then I want to understand it well
@Devendra34 Well. Have you noticed how we are using the property binding and _binding in case of fragments? If you try to know why so you'll get to know reason behind memory leak.
the way how we use this _bindings and all were guided on official docs of ViewBinding in Fragments. So, official docs won't be giving examples that contain a memory leak
the way how we use this _bindings and all were guided on official docs of ViewBinding in Fragments. So, official docs won't be giving examples that contain a memory leak
But google is not a search engine which only shows results from official doc only.
@dhruvnagarajan I have fixed the memory leak because of CustomTabsIntent.Builder().build() Now you just fix the leak because of adapter property. Btw I as a part of learning thought of implementing what I learnt and hence made some changes and CustomTabsIntent.Builder().build() got fixed. If you have any improvement suggestions then it's always welcomed.
@Devendra34 are you clear why memory leak is occurring?
Memory leaks are occurring in almost all fragments because of having non-nullable members.
You just have to handle memory leak due to adapter members inside all the fragment classes.