Unable to add window -- token null is not for an application
导致报这个错是在于new AlertDialog.Builder(mcontext),虽然这里的参数是AlertDialog.Builder(Context context)但我们不能使用getApplicationContext()获得的Context,而必须使用Activity,因为只有一个Activity才能添加一个窗体。
Unable to add window -- token null is not for an application的更多相关文章
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
原博客地址:http://aijiawang-126-com.javaeye.com/blog/662336 在Activity中newSpinner是我把mContext传入,但是出了 andr ...
- Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
在广播中启动一个Dialog时出现如下错误信息:Caused by: android.view.WindowManager$BadTokenException: Unable to add windo ...
- Unable to add window -- token null is not for an application错误的解决方法 android开发
Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not f ...
- Android自用-----WindowManager$BadTokenException: Unable to add window -- token null is not for an application
转自http://www.cnblogs.com/oakpip/archive/2011/04/06/2007310.html 错误产生: private Context mcontext; @Ove ...
- 自定义对话框 提示:Unable to add window token null is not for an application
这是因为在new Dialog(context);的时候传入的context是通过getApplicationContext()获得的,这样就会报错. 把context的获得方式改为MainActiv ...
- android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an applic
之前遇到过这样的问题, 04-12 10:40:33.302: E/AndroidRuntime(17213): Caused by: android.view.WindowManager$BadTo ...
- popupwindow使用之异常:unable to add window -- token null is not valid
使用popwindow中又碰到一个白痴问题,在此留作纪念,希望对大家有帮助 popupwindow之所以叫这个名字,肯定是要从某个地方弹出啦,但是从哪个地方呢?必须是指定一个view嘛 void an ...
- Activity has leaked window that was originally added -界面退出时未关闭对话框异常 android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? -
退出Activity时弹出登录框,点击确定finish当前Activity,结果报了这个错,随后查找资料知道 原因: 是因为退出Activity时没有关闭弹出框,出现了这个错误 解决方法: 只需要在a ...
- bug_ _ android.view.WindowManager$BadTokenException: Unable to add window -- token
========4 关于android的一个常见错误:Unable to add window --token is not valid android.view.WindowManage ...
随机推荐
- sql 时间查询 /sql中判断更新或者插入/查询一年所有双休日
') update [DBPersonnel].[dbo].[TB証明書] ' else INSERT INTO [DBPersonnel].[dbo].[TB証明書] ([社員番号],[身分証明書] ...
- WinForm------PopupMenu控件的使用
转载: http://www.cnblogs.com/xlx0210/archive/2010/07/14/1777366.html
- 通过Unity3D制作天空盒
1. 将全景图片转换为6面的立方体 最初的原始图片 通过PTGui 软件将图片分解为6个部分 2. 通过Unity进行操作 创建3D项目工程 将之前的6张图片导入到Assets中 创建一个Metria ...
- Visual Studio CLR Profiler
http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation-profiling-with-visual-studio ...
- GLSL Interface Block参考
http://www.opengl.org/wiki/Interface_Block_(GLSL) http://stackoverflow.com/questions/9916103/opengl- ...
- union联合体使用详解
1.联合体联合体(union)与结构体(struct)有一些相似之处.但两者有本质上的不同.在结构体中,各成员有各自的内存空间, 一个结构变量的总长度是各成员长度之和.而在联合体中,各成员共享一段内存 ...
- salt stack 工具之一——远程命令
salt stack 远程命令 salt stack是一种自动化的运维工具,可以同时对N台服务器进行配置管理.远程命令执行等操作. salt stack分为两个部分: salt-master,部署在控 ...
- js其它
1.js的数组 * 什么是数组? - 使用变量,var m = 10; - java里面 ...
- Yii2 高级版新建一个 Api 应用
原文地址:http://www.getyii.com/topic/28 先在项目的根目录下复制一份 backend 为 api: cp backend/ api -r 拷贝 api 环境 cp -a ...
- mysql数据表分表策略(转)
mysql分表方法: 方法一. 做数据库集群! 主从数据库 双向热备份(或一对多的数据库实时备份策略),这样可将数据库查询分摊到几个服务器去(可跟服务器负载均衡结合起来架构) 优点:扩展性好,没有多个 ...