I hit my head against the wall during the day, trying to get WebView to work. Below is the code in the main class:
public class fkyougoogle extends Activity {
WebView webview;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
}
}
This is an example of Google Hello, Webview. If I use WebView and try to access www.google.com, then it works fine. If I try to access any other site, then it does not turn on, including loadData, and it just displays a black screen in the emulator. In the end, I would like to read from a local file.
is included in the manifest tag, and the XML schema is the same as the Hello Webview example.
Did I miss something obvious here ?: (
source
share