android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
来源:互联网 发布:linux文件类型有哪些 编辑:程序博客网 时间:2024/05/17 09:05
错误内容:android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
原因:使用Activity的startActivity()没有限制,但是context的startActivity()就需要重新添加一个线程
解决方案:添加
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
标识开启一个新的线程
0 0
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context r
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context r
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context r
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context r
- android.util.AndroidRuntimeException: Calling startActivity from outside of an Activity context
- 【Qt编程】Qt学习之Window and Dialog Widgets
- hdu 1421搬寝室(简单dp)
- node.js 之事件驱动
- Pat(Advanced Level)Practice--1066(Root of AVL Tree)
- 标准c++中string类介绍
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- SEO基础知识完美教程
- 题目1056:最大公约数
- apache2.4.1源码安装过程
- Ubuntu上Invalid command 'RewriteEngine'解决办法
- SVNSubversion 用户权限管理
- SVN 状态图标不显示的解决办法
- AlertDailog: android.view.WindowManager$BadTokenException: Unable to add window -- token null is no
- 润乾——报表展现和输出