Using ShowcaseView with the v7 appcompat ActionBar

2.8k views Asked by At

I'm using the ShowcaseView android library to add a welcome screen when my app is first launched.

Now, on 4.0+ (and possibly 3.0, however I haven't got a device to test it) it works perfectly, however on Gingerbread, the app crashes with the following error.

09-10 15:30:31.182    1650-1650/net.rymate.notes E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.RuntimeException: insertShowcaseViewWithType cannot be used when the theme has no ActionBar
    at com.github.espiandev.showcaseview.ShowcaseView$2.run(ShowcaseView.java:231)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3683)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    at dalvik.system.NativeStart.main(Native Method)

Is there any way to make this work on gingerbread? I want my app to be able to work on nearly all devices, which is why I'm using a lot of support APIs.

Any help is appreciated!

3

There are 3 answers

1
Alex Curran On BEST ANSWER

The short answer is "not yet". Actually working on it as I type! Check the Github issue here for more information.

0
maxcanna On

Fixed in this pull request
Feel free to fork it

0
INDAPP On

You can use a custom view like this: Set Custom Font in the Action Bar,

then create new ShowcaseView like:

ShowcaseView.ConfigOptions co = new ShowcaseView.ConfigOptions();
co.hideOnClickOutside = true;
ShowcaseView sv = ShowcaseView.insertShowcaseView(v, this, 
    "TITLE", "subtitle", co);