ShowCaseView库错误与hide()方法

时间:2015-08-30 08:01:43

标签: android showcaseview

当我在我的设备中使用showcaseview时,不会发生错误。但是在模拟器崩溃时运行应用程序。 showcaseview正常工作,直到想隐藏()它。这是我的代码:

ShowcaseView showcaseView = new ShowcaseView.Builder(MainActivity.this)
            .setContentText("")
            .setContentTitle("")
            .setTarget(new ViewTarget(fab)).setOnClickListener(mOnClickListener)
            .build();

showCaseButton的监听器:

View.OnClickListener mOnClickListener = new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        showcaseView.hide();
    }
};

这是我的logcat:

java.lang.NullPointerException
        at com.github.amlcurran.showcaseview.StandardShowcaseDrawer.erase(StandardShowcaseDrawer.java:75)
        at com.github.amlcurran.showcaseview.ShowcaseView.dispatchDraw(ShowcaseView.java:246)
        at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
        at android.view.View.draw(View.java:10981)
        at android.widget.FrameLayout.draw(FrameLayout.java:450)
        at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2126)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:2026)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1634)
        at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4424)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
        at dalvik.system.NativeStart.main(Native Method)

0 个答案:

没有答案