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

java.lang.NullPointerException 空指针 #25

Open
sjqnice opened this issue Jul 3, 2017 · 3 comments
Open

java.lang.NullPointerException 空指针 #25

sjqnice opened this issue Jul 3, 2017 · 3 comments

Comments

@sjqnice
Copy link

sjqnice commented Jul 3, 2017

从设置里操作完权限返回应用报空指针,由于这句progressDialog.showWithStatus("加载中",SVProgressHUD.SVProgressHUDMaskType.Clear); 引起的。

java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3582)
at android.view.View.updateDisplayListIfDirty(View.java:15244)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3603)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3583)
at android.view.View.updateDisplayListIfDirty(View.java:15244)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3603)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3583)
at android.view.View.updateDisplayListIfDirty(View.java:15244)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:295)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:301)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:345)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2687)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2496)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2121)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6238)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:884)
at android.view.Choreographer.doCallbacks(Choreographer.java:696)
at android.view.Choreographer.doFrame(Choreographer.java:631)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:870)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5621)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

@sjqnice
Copy link
Author

sjqnice commented Jul 4, 2017

我通过下面方式解决了这个问题,不知道哪位大神还有其他更好的解决方案:
修改SVProgressHUD部分代码如下:
@OverRide
public void onAnimationEnd(Animation animation) {
new Handler().post(new Runnable() {
@OverRide
public void run() {
dismissImmediately();
}
});
}

@weishubaoforwork
Copy link

十分感谢大佬

@anxiaojin
Copy link

直接调用dismissImmediately试试 不要退出动画了

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