Android ContextThemeWrapper cannot be cast to android.app.Activity
来源:互联网 发布:怎么重开淘宝网店 编辑:程序博客网 时间:2024/04/29 15:10
java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity
Dialog中的context,在强制装换Activity出现。
将(Activity) mContext,变成:scanForActivity(mContext)
private static Activity scanForActivity(Context cont) { if (cont == null) return null; else if (cont instanceof Activity) return (Activity)cont; else if (cont instanceof ContextWrapper) return scanForActivity(((ContextWrapper)cont).getBaseContext()); return null;}
0 0
- android.view.ContextThemeWrapper cannot be cast to android.app.Activity
- Android ContextThemeWrapper cannot be cast to android.app.Activity
- cannot be cast to android.app.Fragment
- android.app.Application cannot be cast to
- Unable to instantiate activity cannot be cast to android.app.Activity
- android.support.v7.widget.AppCompatTextView cannot be cast to android.app.Activity
- ButterKnife java.lang.ClassCastException: android.view.View cannot be cast to android.app.Activity
- android.widget.LinearLayout cannot be cast to android.app.Activity处理
- com.example.firstservice.FirstService cannot be cast to android.app.Activity
- java.lang.ClassCastException: android.app.Application cannot be cast to *****
- 【异常】android.app.Application cannot be cast to****
- java.lang.ClassCastException: android.app.Application cannot be cast to *****
- java.lang.ClassCastException: android.app.Application cannot be cast to
- java.lang.ClassCastException: android.app.Application cannot be cast to
- java.lang.ClassCastException: android.app.Application cannot be cast to
- android.app.Application cannot be cast to 新建的Application
- cannot be cast to android.widget.HeaderViewListAdapter
- cannot be cast to android.widget.HeaderViewListAdapter
- 打印html到pdf图片处理
- python中函数参数是引用还是传值
- UML用例图总结
- MySQL命令执行过程源码相关模块
- linux下编译make文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录”
- Android ContextThemeWrapper cannot be cast to android.app.Activity
- 二分查找(Binary Search)
- Android中的多线程编程详解
- [289]Game of Life
- php 安装 thrift
- Red Hat Enterprise Linux 5.1 Server(正式版)各版本下载2011-04-17 22:21
- 什么是比特币
- 平均背景法的原理
- centos 6.5 快速安装PHP环境