【发布时间】:2014-10-23 14:42:45
【问题描述】:
我正在使用 WebView 在 Android 应用中打开网页。 我将布局描述为:
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
在 Android Manifest 文件中添加权限为:
<uses-permission android:name="android.permission.INTERNET" />
并在我的活动类中使用 WebView 作为:
WebView theWebPage = new WebView(this);
setContentView(theWebPage);
theWebPage.loadUrl("http://www.google.com");
完成后,我在几部 Android 手机上运行了该应用。打开后,应用程序会询问使用哪个应用程序(Chrome、Mozilla 或手机上安装的任何其他浏览器)来打开网页,即“http://www.google.com”。
我希望应用程序在其内部打开网页。帮忙?
【问题讨论】: