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

【BUG反馈】友盟收到的空指针异常 #281

Closed
aheven opened this issue Mar 1, 2023 · 4 comments
Closed

【BUG反馈】友盟收到的空指针异常 #281

aheven opened this issue Mar 1, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@aheven
Copy link

aheven commented Mar 1, 2023

问题描述:

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
	at android.view.ViewConfiguration.get(ViewConfiguration.java:545)
	at android.view.View.<init>(View.java:5353)
	at com.kongzue.dialogx.style.views.ProgressView.<init>(ProgressView.java:1)
	at ae.a$b.f(Unknown Source:2)
	at xd.f$f.d(WaitDialog.java:7)
	at xd.f$a.run(WaitDialog.java:6)
	at com.kongzue.dialogx.interfaces.BaseDialog.X(BaseDialog.java:3)
	at xd.f.o1(WaitDialog.java:2)
	at xd.f.r1(WaitDialog.java:1)
	at xd.f.p1(WaitDialog.java:4)

设备信息:

设备:vivo
机型:V2203A
Android版本:12

是否在 Demo 中能复现此问题?

未尝试

@aheven aheven added the bug Something isn't working label Mar 1, 2023
@kongzue
Copy link
Owner

kongzue commented Mar 1, 2023

请确认在启动对话框前已经正确初始化,看日志是ProgressView在构造时,context为空导致的

@aheven
Copy link
Author

aheven commented Mar 1, 2023

请确认在启动对话框前已经正确初始化,看日志是ProgressView在构造时,context为空导致的

不是所有机型都报错的,已经在Application 中初始化 DialogX.init(context)
应该是偶现的。

@kongzue
Copy link
Owner

kongzue commented Mar 1, 2023

之前有确认过一种情况,app在闪退后或长时间处于后台被回收被系统重启了,此时可能出现DialogX初始化的context与重启后的applicationContext不一致,建议尝试在启动对话框时使用 .show(activity)

@aheven
Copy link
Author

aheven commented Mar 1, 2023

got it.

@aheven aheven closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants