Skip to content
This repository has been archived by the owner on Apr 24, 2018. It is now read-only.

Getting an exception with the code in the example #449

Open
guybashan opened this issue Nov 4, 2017 · 3 comments
Open

Getting an exception with the code in the example #449

guybashan opened this issue Nov 4, 2017 · 3 comments

Comments

@guybashan
Copy link

I simply copy & paste the code in the example. My activity contains a view pager.
I get this exception:

java.lang.RuntimeException: insertShowcaseViewWithType cannot be used when the theme has no ActionBar
at com.github.amlcurran.showcaseview.targets.ActionBarReflector.getHomeButton(ActionBarReflector.java:43)
at com.github.amlcurran.showcaseview.targets.ActionBarReflector.getActionBarView(ActionBarReflector.java:36)
at com.github.amlcurran.showcaseview.targets.ActionViewTarget.setUp(ActionViewTarget.java:38)
at com.github.amlcurran.showcaseview.targets.ActionViewTarget.getPoint(ActionViewTarget.java:45)
at com.github.amlcurran.showcaseview.ShowcaseView$1.run(ShowcaseView.java:191)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

@guybashan
Copy link
Author

I also tried this code:

    val target = ViewTarget(R.id.toolbarBottom, this)

    ShowcaseView.Builder(this, true)
            .setTarget(target)
            .setContentTitle("title")
            .setContentText("content").build()

And got this exception:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getLocationInWindow(int[])' on a null object reference
at com.github.amlcurran.showcaseview.targets.ViewTarget.getPoint(ViewTarget.java:41)
at com.github.amlcurran.showcaseview.ShowcaseView$1.run(ShowcaseView.java:191)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

@Kvaibhav01
Copy link

I also have the same error. How to resolve it?

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

No branches or pull requests

3 participants
@guybashan @Kvaibhav01 and others