We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
BallBeatIndicator ballBeatIndicator = new BallBeatIndicator(); AVLoadingIndicatorView avLoadingIndicatorView = new AVLoadingIndicatorView(this); avLoadingIndicatorView.setIndicator(ballBeatIndicator); avLoadingIndicatorView.setIndicatorColor(0xffffff);
我这里动态构造抛出下面的异常
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.wang.avi.Indicator.setColor(int)' on a null object reference
是因为AVLoadingIndicatorView在构造函数里没给indicatorName一个默认值:
String indicatorName=a.getString(R.styleable.AVLoadingIndicatorView_indicatorName); int indicatorColor=a.getColor(R.styleable.AVLoadingIndicatorView_indicatorColor, Color.WHITE); setIndicator(indicatorName); //这里没有默认值 setIndicatorColor(indicatorColor); //导致这里空指针异常
The text was updated successfully, but these errors were encountered:
好的,我检查一下。
Sorry, something went wrong.
8e7b2a3
Fix #47
e641f9e
已修复,希望你可以帮我测试一下。你需要更新至最新版本compile 'com.wang.avi:library:2.1.2' ,如有问题,欢迎告诉我,谢谢 @JackRo
compile 'com.wang.avi:library:2.1.2'
最新版2.1.3又有这个问题了!降为2.1.2没问题,最新版怎么回事呢?
No branches or pull requests
BallBeatIndicator ballBeatIndicator = new BallBeatIndicator(); AVLoadingIndicatorView avLoadingIndicatorView = new AVLoadingIndicatorView(this); avLoadingIndicatorView.setIndicator(ballBeatIndicator); avLoadingIndicatorView.setIndicatorColor(0xffffff);
我这里动态构造抛出下面的异常
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.wang.avi.Indicator.setColor(int)' on a null object reference
是因为AVLoadingIndicatorView在构造函数里没给indicatorName一个默认值:
String indicatorName=a.getString(R.styleable.AVLoadingIndicatorView_indicatorName); int indicatorColor=a.getColor(R.styleable.AVLoadingIndicatorView_indicatorColor, Color.WHITE); setIndicator(indicatorName); //这里没有默认值 setIndicatorColor(indicatorColor); //导致这里空指针异常
The text was updated successfully, but these errors were encountered: