Skip to content
New issue

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

setEmptyView(mEmptyView, true)之后,setAdapter(adapter)就会空指针,如果不传true,则不抱错,但是空数据的时候不显示mEmptyView #8

Closed
LarryLGHao opened this issue Mar 23, 2016 · 2 comments

Comments

@LarryLGHao
Copy link

java.lang.NullPointerException
at cn.iwgang.familiarrecyclerview.FamiliarRecyclerView.setAdapter(FamiliarRecyclerView.java:213)
at com.liuliuyxq.android.activities.FansOrAttentionActivity$1.success(FansOrAttentionActivity.java:138)
at com.liuliuyxq.android.activities.FansOrAttentionActivity$1.success(FansOrAttentionActivity.java:115)
at retrofit.CallbackRunnable$1.run(CallbackRunnable.java:45)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)

@LarryLGHao LarryLGHao changed the title setEmptyView(mEmptyView, true)之后,setAdapter(adapter)就会空指针 setEmptyView(mEmptyView, true)之后,setAdapter(adapter)就会空指针,如果不传true,则不抱错,但是空数据的时候不显示mEmptyView Mar 23, 2016
@iwgang
Copy link
Owner

iwgang commented Apr 7, 2016

你好,可以提供一下代码吗?

@iwgang
Copy link
Owner

iwgang commented Apr 7, 2016

知道什么原因了,你的emptyView没有和RecyclerView放在一个布局中吧?

设置setEmptyView(view, true) 可以不放layout.xml中, 但setEmptyView(view)中的view必需和RecyclerView放在同一个布局中

具体原因完全同ListView

@iwgang iwgang closed this as completed in a3be7e8 Apr 7, 2016
iwgang added a commit that referenced this issue Apr 7, 2016
#更新记录
1. 优化Grid最后一个item的分割线显示逻辑,之前为隐藏,现改为显示,可以使用frv_isNotShowGridEndDivider配置为true来达到隐藏
2. 增加动态同时设置分割线及分割线高度的方法setDivider(int height, Drawable divider)
3. fix #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants