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

使用SVProgressHUD遇到一个问题 #17

Open
weijia1991 opened this issue Dec 7, 2016 · 1 comment
Open

使用SVProgressHUD遇到一个问题 #17

weijia1991 opened this issue Dec 7, 2016 · 1 comment

Comments

@weijia1991
Copy link

你好,我有这么一种使用场景:用户点击登录时,showWithStatus(登录中...),然后用户登录失败,需要dismiss登录中的弹框,然后showErrorWithStatus("")提示用户登录失败。但这样存在一个bug,会报java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference
我做了一下实验,同时new两个SVProgressHUD,然后分别showErrorWithStatus(""),也会报这个错。
能不能优化一下,让它像Toast一样呢?

@chenglei1986
Copy link

@weijia1991

SVProgressHUD.java中的dismissImmediately()方法修改如下:

    public void dismissImmediately() {
        mSharedView.dismiss();
        decorView.post(new Runnable() {
            @Override
            public void run() {
                rootView.removeView(mSharedView);
                decorView.removeView(rootView);
            }
        });
        isShowing = false;
        isDismissing = false;
        if (onDismissListener != null) {
            onDismissListener.onDismiss(this);
        }
    }

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