VEINHORN / ScrollGalleryView

:bridge_at_night: Android image gallery with bottom scroll view
MIT License
531 stars 157 forks source link

NullPointerException after activity recreation #88

Open appach22 opened 5 years ago

appach22 commented 5 years ago

I'm having an exception after leaving an activity with gallery and bringing it back in the case activity was destroyed by system while being in background (you can easily reproduce it if you turn on "Don't keep activities" setiing in a Developer options). EDIT: happens only while recreation takes place after returning to the gallery fragment from a child fragment

     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.veinhorn.scrollgalleryview.HackyViewPager.setLocked(boolean)' on a null object reference
        at com.veinhorn.scrollgalleryview.ImageFragment.onCreateView(ImageFragment.java:67)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2439)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
        at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
        at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
        at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:620)
        at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:178)