MaterialShowcaseView
MaterialShowcaseView copied to clipboard
Im getting java.lang.IllegalStateException: Cannot start this animator on a detached view! , when i call the toolbar items from fragment
plz send your code
he problem exist in the library, because the view is not present/showing when the animator is called. If, you put your showcase View in a runnable it will works.
Something like this:
myView.post(new Runnable() { @Override public void run() { new MaterialShowcaseView.Builder(MainActivity.this) .setTarget(myView) .setDismissText("GOT IT") .setTitleText(R.string.title) .setContentText(R.string.description) .setFadeDuration(1000) .setDismissOnTouch(true) .show(); } });
I am getting this too.
Edit 1:
By adding a view.post { /... }
the post
method waits the view gets ready and then animate.
Fatal Exception: java.lang.IllegalStateException: Cannot start this animator on a detached view! at android.view.RenderNode.addAnimator(RenderNode.java:803) at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:300) at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:282) at android.animation.RevealAnimator.(RevealAnimator.java:37) at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:71) at uk.co.deanwild.materialshowcaseview.CircularRevealAnimationFactory.animateInView(Unknown Source:25) at uk.co.deanwild.materialshowcaseview.MaterialShowcaseView.animateIn(Unknown Source:20) at uk.co.deanwild.materialshowcaseview.MaterialShowcaseView$1.run(Unknown Source:10) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:7000) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)