转于:http://blog.csdn.net/wsz1z154/article/details/7724912
--------------------------------------------------------------------------------
在创建一个Dialog时,发生的错误:
Unable to add window -- token null is not for an application
- AlertDialog.Builder builder;
- AlertDialog alertDialog;
- Context mContext = getApplicationContext();
- LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
- View layout = inflater.inflate(R.layout.custom_dialog, (ViewGroup)findViewById(R.id.layout_root));
- TextView text = (TextView) layout.findViewById(R.id.text);
- text.setText("Hello, this is a custom dialog!");
- ImageView image = (ImageView) layout.findViewById(R.id.image);
- image.setImageResource(R.drawable.icon);
- builder = new AlertDialog.Builder(mContext);
- builder.setView(layout);
- alertDialog = builder.create();
- alertDialog.show();
查询SDK帮助文档:
Return the context of the single, global Application object of the current process. This generally should only be used if you need a Context whose lifecycle is separate from the current context, that is tied to the lifetime of the process rather than the current component.
把这句Context mContext = getApplicationContext();
改成Activity.this即可
相关推荐
ngx-window-token 角度处理文件的方式相同。 使用此模块,您可以像使用DOCUMENT令牌一样使用WINDOW令牌。 5.0.0版以后的重大更改 如果窗口未定义,则返回未定义。 以前,它甚至不注入WindowToken。 1.0.2版之后的...
注意:PopupWindow组件的使用问题,PopupWindow是一个阻塞对话框,如果你直接在Activity创建的方法中显示它,则会报错:android.view.WindowManager$BadTokenException:Unable to add window -- token null is not ...
前端开源库-google-translate-tokengoogle translate token,一个生成免费使用google translate api所需token的包。
随着微服务的流行,服务和服务之间的稳定性变得越来越重要。Sentinel 以流量为切入点,从流量控制、熔断降级、系统负载保护等多个维度保护服务的稳定性。
Sentinel 提供一个轻量级的开源控制台,它提供机器发现以及健康情况管理、监控(单机和集群),规则管理和推送的功能。是一款面向云原生微服务的高可用流控防护组件。
npm install bpmn-js-token-simulation 作为附加模块添加到 。 造型师 var BpmnModeler = require ( 'bpmn-js/lib/Modeler' ) ; var tokenSimulation = require ( 'bpmn-js-token-simulation' ) ; var modeler = ...
mapbox-gl 2.7.0 去token
前端开源库-gulp-token-replacegulp token replace,gulp的token replace插件
Laravel开发-laravel-token Laravel 4令牌管理
开源项目-b3ntly-distributed-token-bucket.zip,分布式令牌桶库
开源项目-marksalpeter-token.zip,一个简单的base62编码的Go令牌库
Laravel开发-laravel-passport-one-time-token 使用Laravel Passport可以轻松创建一次性代币
开源项目-Code-Hex-go-github-token.zip,很容易获得Github访问令牌
前端项目-ng-token-auth,基于令牌的Angular JS认证系统。包括对使用Facebook、Github和Google进行OAuth2身份验证的支持。
前端开源库-gulp-token-replace.zip
这个是京东x-api-eid-token生成源代码 易语言源代码哦,有需要的可以免费下载啊
Struts 之旅 - 重复提交 token
「工控安全」asec-w04-derived-unique-token-per-transaction - APT 数据泄露 工控安全 勒索软件 大数据 APT攻击
信息安全_数据安全_asec-w04-derived-unique-token-per-transaction 安全分析 企业安全 安全验证 安全 网络犯罪
Lsky-pro的token获取程序