2012-03-01 107 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時崩潰。