amlcurran / ShowcaseView

[Archived] Highlight the best bits of your app to users quickly, simply, and cool...ly
5.6k stars 1.29k forks source link

App Crashes when pressing next button very quickly. I have more than one viewTarget On my first screen but when I click on next button at a faster rate app crashes every time. Any solution? #328

Open abdul-khalid opened 8 years ago

abdul-khalid commented 8 years ago
11-20 07:17:38.009  10865-10865/com.androidapp.ketchupp E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.androidapp.ketchupp, PID: 10865
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Bitmap.eraseColor(int)' on a null object reference
            at com.github.amlcurran.showcaseview.StandardShowcaseDrawer.erase(StandardShowcaseDrawer.java:75)
            at com.github.amlcurran.showcaseview.ShowcaseView.dispatchDraw(ShowcaseView.java:246)
            at android.view.View.updateDisplayListIfDirty(View.java:14199)
            at android.view.View.getDisplayList(View.java:14226)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3390)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3369)
            at android.view.View.updateDisplayListIfDirty(View.java:14164)
            at android.view.View.getDisplayList(View.java:14226)
            at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273)
            at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279)
            at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318)
            at android.view.ViewRootImpl.draw(ViewRootImpl.java:2536)
            at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2352)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1982)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5891)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
            at android.view.Choreographer.doCallbacks(Choreographer.java:580)
            at android.view.Choreographer.doFrame(Choreographer.java:550)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
            at android.os.Handler.handleCallback(Handler.java:739)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5290)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
11-20 07:17:38.010  10865-10865/com.androidapp.ketchupp D/AppTracker﹕ App Event: crash
11-20 07:17:38.062  10865-10865/com.androidapp.ketchupp I/Process﹕ Sending signal. PID: 10865 SIG: 9
amlcurran commented 8 years ago

Interesting! Not seen this one before, will take a look this weekend. Thanks for reporting

amlcurran commented 8 years ago

If you have any sample code, that would be great

Ryan-Pierce commented 8 years ago

Had the same issue. It's because when showcaseview.hide() is called (at least for me), the user can still click on "next" as the button is fading away but not yet completely hidden. My work around was to showcaseview.setvisibility(View.GONE) before hide() is called. This prevents the user from seeing the pretty fade out animation, but the alternative is a fatal crash... The null pointer should be caught, but i dont think it can be caught on our end without overriding showcaseview methods.