TapTargetView icon indicating copy to clipboard operation
TapTargetView copied to clipboard

NPE crash when rotating device

Open AndreSand opened this issue 4 years ago • 0 comments

  • [X] I have verified the issue exists on the latest version
  • [X] I am able to reproduce it

I'm seeing the crash when the tooltip is shown and I rotate the screen. I added .dismiss() on Activity onStop() butI still see the crash.

Version used: implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.0'

Stack trace:

2021-02-16 17:47:21.751 13336-13336 E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.dispatchDetachedFromWindow()' on a null object reference
        at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3806)
        at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:4146)
        at android.view.ViewRootImpl.doDie(ViewRootImpl.java:7151)
        at android.view.ViewRootImpl.die(ViewRootImpl.java:7128)
        at android.view.WindowManagerGlobal.removeViewLocked(WindowManagerGlobal.java:490)
        at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:428)
        at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:126)
        at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4992)
        at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5255)
        at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5187)
        at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Android version: Android 11

AndreSand avatar Feb 17 '21 01:02 AndreSand