Chapter 25 Challenge 1

I was wondering if some one could take a look at this and see if it is a viable solution.

in PhotoGalleryFragment’s onCreateView i made the following changes:

    /** Chapter 25 challenge 1 **/
    viewLifecycleOwnerLiveData.observe(viewLifecycleOwner, Observer {

/** Instead of **/
// viewLifecycleOwner.lifecycle.addObserver(
// thumbnailDownloader.viewLifecycleObserver
// )

Everything seems to be working fine across rotation. However, I wasn’t able to find many examples of the usage. So this was pretty much just me winging it.

There is a recommendation in the book:

When a non-null value is published, observe the fragment’s view lifecycle, accessible through

So, in my opinion, there should be a null check.