Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Fix NullPointerExceptopn when getParent is null in applyToolTipPosition() #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dkostyrev
Copy link

Received several crashes in applyToolTipPosition(). Was using ToolTipView on a fragment inside ViewPager.

Stacktrace:

java.lang.NullPointerException
at com.haarman.supertooltips.ToolTipView.applyToolTipPosition(ToolTipView.java:138)
at com.haarman.supertooltips.ToolTipView.onPreDraw(ToolTipView.java:99)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:888)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2173)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6567)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:573)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5476)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)

@dkostyrev dkostyrev closed this Nov 1, 2014
@dkostyrev dkostyrev reopened this Nov 1, 2014
@hendrawd
Copy link

I got the same error, but don't know how to submit a new issue here. Here is my stack trace:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getLocationOnScreen(int[])' on a null object reference
       at com.nhaarman.supertooltips.ToolTipView.applyToolTipPosition(ToolTipView.java:155)
       at com.nhaarman.supertooltips.ToolTipView.onPreDraw(ToolTipView.java:107)
       at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1970)
       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:5289)
       at java.lang.reflect.Method.invoke(Method.java)
       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)
       at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:133)

Here is my dependency import on build.gradle
compile 'com.nhaarman.supertooltips:library:3.0.+'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants