-
Notifications
You must be signed in to change notification settings - Fork 181
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
Null Pointer Exception when calling show() function #29
Comments
+1 |
In my case, |
+1, |
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.github.jorgecastilloprz.progressarc.ProgressArcView.show()' on a null object reference |
+1 |
1 similar comment
+1 |
After checking the library source code, addArcView() is called by onMeasure() method. As a result of that, you should not use the show function until the activity is completely shown. A good place to call show() is in onWindowFocusChanged(hasFocus == true) function . @OverRide public void onWindowFocusChanged(boolean hasFocus) {
} You should not use the show() function in OnCreate, OnResume, OnStart. |
You can modify the source code . Adding an OnGlobalLayoutListener before invoking the method show() will work for me
|
In the following code, if
fabProgressCircle.show()
is called outside the Handler (which delays it's excecution for 500 milliseconds), the App crashes with Null Pointer Exception for fabProgressCircle.show(). Why could this happen? Does thefabProgressCircle
needs some time to instantiate?The text was updated successfully, but these errors were encountered: