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

空指针异常 #12

Closed
qyliuyawei opened this issue Sep 11, 2017 · 3 comments
Closed

空指针异常 #12

qyliuyawei opened this issue Sep 11, 2017 · 3 comments

Comments

@qyliuyawei
Copy link

平时测试都没有什么问题,但是在后台却收集到了很多空指针异常的问题;
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup)' on a null object reference
at com.classic.common.MultipleStatusView.inflateView(MultipleStatusView.java)
at com.classic.common.MultipleStatusView.showEmpty(MultipleStatusView.java)
at com.classic.common.MultipleStatusView.showEmpty(MultipleStatusView.java)

MultipleStatusView是直接下载布局里面的,通过butterknife来绑定的控件;
求解答;

@LambdaV5
Copy link

LambdaV5 commented Nov 9, 2017

mInflater = LayoutInflater.from(getContext());
把这段代码放在构造函数,然后detach的时候不用置空,并不会引起内存泄漏

@qyxxjd
Copy link
Owner

qyxxjd commented Nov 9, 2017

@LambdaV5 Thank you. 我周末抽空处理下,最近公司比较忙

@qyxxjd
Copy link
Owner

qyxxjd commented Nov 12, 2017

查看 v1.4

@qyxxjd qyxxjd closed this as completed Nov 12, 2017
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

3 participants