2012-03-01 112 views
0

我的程序以EULA开头。 EULA通过WebView在AlertDialog中显示。 A有文字链接到网站。当点击链接我收到错误信息:从AlertDialog打开url链接

03-01 18:44:48.421: E/AndroidRuntime(8862): android.util.AndroidRuntimeException: 
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? 

怎么办?

回答

0

我发现问题了。除了使用getBaseContext()的:

WebView wv = new WebView(getBaseContext()); 

我把:此

WebView wv = new WebView (this); 

都是背景。两者都使WebView完美,但getBaseContext在点击url时崩溃。