question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] - OnDestroyView

See original GitHub issue

I noticed that in your Android examples you override the OnDestroyView. It is mandatory to use your library? I’m currently using Picasso, and i consider changing to FFImageLoading. Can you detail that please?

public override void OnDestroyView()
        {
            if (_imgDisplay != null)
            {
                _imgDisplay.Dispose();
                _imgDisplay = null;
            }

            base.OnDestroyView();
        }

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
molinchcommented, Mar 15, 2016

Oh yes my bad! You’re totally right 😃 Now I remember everything !

Basically @jzeferino when you use FindViewById it is a good practice to dispose views you found (this reduces GC’s work). Which is why I added this call in OnDestroyView.

If you google ‘Xamarin FindViewById Dispose’ I am sure you will find plenty of interesting resources from StackOverflow or forums.

0reactions
jzeferinocommented, Mar 18, 2016

Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fragment lifecycle: when "ondestroy" and "ondestroyview" ...
Take a look at this question: Why implement onDestroy() if it is not guaranteed to be called? Basically, onDestroy() is only guaranteed to ......
Read more >
Question: `onDestroy` of Fragment can be called before ` ...
Question : `onDestroy` of Fragment can be called before `onCreateView` ? Today I got a weird crash, that shows me that this could...
Read more >
Fragment lifecycle
Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin. ... Start...
Read more >
Activity's onDestroy / Fragment's onDestroyView set Null ...
Android : Activity's onDestroy / Fragment's onDestroyView set Null practices [ Beautify ... Question / answer owners are mentioned in the video.
Read more >
cannot cleanup fragment in `onDestroyView()` · Issue #12 · ...
i am using this library with a RecyclerView, and i need to cleanup resources in onDestroyView(). in order to prevent a memory leak...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found