We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activity中使用BeamListFragment,程序压入后台(如按home键,用360卫士清理内存),再恢复时,会报空指针。 原因可能是: 压入后台, Fragment可能会系统回收了,Presenter中的view=null了。再恢复时,没有走Fragment的onCreate方法,只走了onCreateView ,
这时在onCreateView 中执行:
if (mListConfig.mStartWithProgress&&!getPresenter().inited) mListView.setAdapterWithProgress(mAdapter = getPresenter().getAdapter()); else mListView.setAdapter(mAdapter = getPresenter().getAdapter());
DataAdapter引用的getview就空指针异常了。
The text was updated successfully, but these errors were encountered:
抱歉拖了这么久才有空。 有错误log吗。我这边怎么实验都没问题。 Fragment被回收再恢复肯定要走onCreate方法。走了onCreate就能重新绑定。
Sorry, something went wrong.
另外据我所知。AMS在内存不足时,是将进程信息(包含Activity)保存到AMS,再杀掉进程。 不可能存在Activity/Fragment被回收。而进程却存在的情况吧?
No branches or pull requests
Activity中使用BeamListFragment,程序压入后台(如按home键,用360卫士清理内存),再恢复时,会报空指针。
原因可能是:
压入后台, Fragment可能会系统回收了,Presenter中的view=null了。再恢复时,没有走Fragment的onCreate方法,只走了onCreateView ,
这时在onCreateView 中执行:
if (mListConfig.mStartWithProgress&&!getPresenter().inited) mListView.setAdapterWithProgress(mAdapter = getPresenter().getAdapter());
else mListView.setAdapter(mAdapter = getPresenter().getAdapter());
DataAdapter引用的getview就空指针异常了。
The text was updated successfully, but these errors were encountered: