Android WebView问题

时间:2012-03-13 00:40:18

标签: android webview

我开发了一个名为“Rockfish Motorsports”的应用程序,你想要它:) 无论如何,当应用程序加载页面时,它会打开浏览器,而不是将其加载到webview中? 如果你可以提供帮助,那就是编码

RMS / RES /布局/ main.xml中

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

 <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    />

 <WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>

</LinearLayout>

的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="XXXXXXX"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />

<application
    android:icon="@drawable/new_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".RockfishMotorsportsActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
 </application>
</manifest>

1 个答案:

答案 0 :(得分:0)

我在Android电子市场上找不到应用程序,但我假设你所包含的webview正试图进入用户操作的不同页面,默认情况下会启动浏览器。要在WebView中加载新页面,请查看其他SO答案:

Android WebView click opens default browser