Null Pointer Exception when stepView.go(1, true); only for 1...not in any other position #18
Comments
don't use this library. use this https://github.com/baoyachi/StepView |
Download the source code and add measure(int width,int height) method call in else part of go(int step, boolean animate) method.
|
Why would you need that?
…On Mon, Jun 18, 2018, 14:26 Vinayak2108 ***@***.***> wrote:
Download the source code and add measure(int width,int height) method call
in go(int step, boolean animate) method.
public void go(int step, boolean animate) {
measure(getWidth(),getHeight());
if (step >= START_STEP && step < getStepCount()) {
if (animate && animationType != ANIMATION_NONE) {
if (Math.abs(step - currentStep) > 1) {
endAnimation();
currentStep = step;
invalidate();
} else {
nextAnimatedStep = step;
state = ANIMATE_STEP_TRANSITION;
animate(step);
invalidate();
}
} else {
currentStep = step;
invalidate();
}
}
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFDzvgEJUQXdORRYm7x7ktPZ381yiG5Bks5t945YgaJpZM4SoZSf>
.
|
when we call step.go(1,true) from onCreate() the app get crash due to null pointer exception and on further inspection i found in method getAnimator() startLinesX and endLinesX are null and these variables are initialized in measureLines() method which get call from chained calls started from onMeasure() method. so measure() call before getAnimator() insure startLinesX, endLinesX should not be null. if i am wrong or you know better solution for this issue then let me know. |
That is should not happen if you initialized the view properly. Do you put
the view into an xml file or create it in code? Could you show me how to
reproduce the issue?
…On Mon, Jun 18, 2018, 15:37 Vinayak2108 ***@***.***> wrote:
when we call step.go(1,true) from onCreate() the app get crash due to null
pointer exception and on further inspection i found in method getAnimator()
startLinesX and endLinesX are null and these variables are initialized in
measureLines() method which get call from chained calls started from
onMeasure() method. so measure() call before getAnimator() insure
startLinesX, endLinesX should not be null. if i am wrong or you know better
solution for this issue then let me know.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFDzvvmIA_0xu7w3y52xRVMPvGHpreTTks5t9579gaJpZM4SoZSf>
.
|
Here is My Code Layout file
Activity File
|
As far as I understand, you are trying to start an animation while the view is not measured yet. We can't measure view before the framework ask us about it, providing with the actual MeasureSpecs.
Or just skip the animation: go(step, false). I am going to fix this by checking, whether we measured or not, before starting an animation. |
Fixed in 1.2.8 |
Sir, I'm also getting same error
|
HERE IS MY ARRAY from resourse
Processing
Shipped
Delivery
The text was updated successfully, but these errors were encountered: