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 ...
 
随机推荐
- 转:在VS2010下编译、调试和生成mex文件
			
最近帮人调了一个程序,是网上公开的代码,利用matlab与c++混合编程做三维模型关键点检测,发现他们可以用VS2010编译.调试.生成mexw32文件,因此觉得之前在Matlab上利用mex命令真是 ...
 - ORACLE ORA-01157: 无法标识/锁定数据文件
			
create undo tablespace MOZI datafile 'E:\oracle\product\10.2.0\oradata\orcl\MOZI.DBF' size 2048M ext ...
 - 从零开始HTML(一 2016/10/17)
			
就是准备跟着霹雳猿教程过一遍HTML啦,边看边记录更便于理解记忆吧~ 1.属性 HTML 标签可以拥有属性.属性提供了有关 HTML 元素的更多的信息.属性总是以名称/值对的形式出现,比如:name= ...
 - Java——URL和URLConnection
			
使用URL读取内容 import java.awt.im.InputContext; import java.io.InputStream; import java.net.MalformedURLE ...
 - Java实例分析:宠物商店
			
设计一个“宠物商店”,在宠物商店中可以有多种宠物,试表示出此种关系,并要求可以根据宠物的关键字查找相应的宠物信息. //======================================== ...
 - Bitmap动画
			
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html htt ...
 - Django笔记-常见错误整理
			
1.csrf错误 解决方法:在settings.py里注释掉相关内容即可 MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.Sess ...
 - ActionScript学习笔记
			
ActionScript学习笔记 ActionScript中预定义的数据类型:Boolean.int.Number.String.uint 其中,int.Number.uint是处理数字的.int用来 ...
 - verilog阻塞与非阻塞的初步理解(一)
			
通过两个模块来区别两者.测试平台:Modelsim altera 6.5b 阻塞模块: module blocking(clk,a,b,c); :] a; input clk; :] b,c; :] ...
 - 【转】随机函数 rand() srand() 以及seed的原理
			
from:http://blog.csdn.net/feige2008/article/details/6943885 标准库<cstdlib>(被包含于<iostream> ...