菜鸟学android——WebView点击链接发生错误:Calling startActivity() from outside of an Activity context requires...
2014-03-25 09:12
756 查看
今天在应用中动态生成WebView,然后设置要显示的html数据,结果运行后,点击网页的链接出现了错误:
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want
网上没找到答案,后来自己找到哪里出了问题。我开始这样创建WebView
改成:
具体原因还不是很清楚,先知道怎么解决问题吧。
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want
网上没找到答案,后来自己找到哪里出了问题。我开始这样创建WebView
WebView wv = new WebView(getApplecation());
改成:
WebView wv = new WebView(MainActivity.this);这样就好了,可以点击链接在默认浏览器中浏览。
具体原因还不是很清楚,先知道怎么解决问题吧。
相关文章推荐
- android.util.AndroidRuntimeException Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? com.uethinking.microvideo.manag
- AndroidRuntimeException “Calling startActivity() from outside of an Activity context requires the FL
- Android:Calling startActivity() from outside of an Activity 错误
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- android.util.AndroidRuntimeException: Calling startActivity from outside of an Activity context
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW _TASK flag.
- 处理ERROR/AndroidRuntime(5066) Calling startActivity() from outside of an Activity context require...
- Android - Error:Calling startActivity() from outside of an activity context
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK fla
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK fla
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
- Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag