bingoogolapple / BGABanner-Android

引导界面滑动导航 + 大于等于1页时无限轮播 + 各种切换动画轮播效果
4.17k stars 782 forks source link

Caused by: java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity #215

Closed Andy045 closed 5 years ago

Andy045 commented 5 years ago

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.handy.app/com.handy.frame.module.guide.GuideActivity}: java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2679) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2740) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1486) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6166) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) Caused by: java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity at cn.bingoogolapple.bgabanner.BGABanner.setEnterSkipViewIdAndDelegate(BGABanner.java:447) at com.handy.frame.module.guide.GuideActivity.initViewHDB(GuideActivity.java:85) at com.handy.base.app.BaseActivity.onStart(BaseActivity.java:137) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1249) at android.app.Activity.performStart(Activity.java:6768) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2642) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2740)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1486)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6166)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) 

Andy045 commented 5 years ago

compileSdkVersion: 28 minSdkVersion : 19 targetSdkVersion : 28

com.android.support:appcompat-v7 : "28.0.0"

com.android.tools.build:gradle:3.4.0

Andy045 commented 5 years ago

希望可以给图片指示点设置大小或者内置固定大小。指示器图片压缩到28x28后会出现模糊的情况。

bingoogolapple commented 5 years ago

1、类型转换异常和这个库没关系,再检查一下你项目中取 context 的方式 2、指示器可以自定义,具体大小得看你指定的图片大小或指定的 shape 中的 size image

image