ethanhua / Skeleton

A library provides an easy way to show skeleton loading view like Facebook and Alipay
3.68k stars 457 forks source link

fragment+viewPager #52

Open rwzhang opened 4 years ago

rwzhang commented 4 years ago

Abnormal crash! java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.unFocus(android.view.View)' on a null object reference at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5465) at android.view.ViewGroup.removeViewAt(ViewGroup.java:5428) at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1250) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079) at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869) at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824) at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727) at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:230)

wenzhihao123 commented 3 years ago

Do not use fragment's RootView as the parameter value of the bind function and call it in onViewCreated function or later