Android : Android WebView failing in simulator with ERR_CONNECTION_TIMED_OUT

on Thursday, April 2, 2015


I want to have a 'Help' function in my app that links to a help page that is off my blog.


I have created a very trivial fragment to host the webview -- but when it displays, it comes up blank and then after a while will display


Webpage not available. The webpage at could not be loaded because: net::ERR_CONNECTION_TIMED_OUT.


To make sure there wasn't an issue with my page I replaced it with http://google.com and got the same error.


Here's my entire fragment:


public class HelpFragment extends Fragment {



public HelpFragment() {
// Required empty public constructor
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {

WebView webView = new WebView(getActivity());
webView.loadUrl("http://google.com");
return webView;
}


}


I have uses-permission android:name="android.permission.INTERNET" in my manifest.


This is in the simulator -- I don't have a real device to test on at the moment.


0 comments:

Post a Comment