1

だからここに私のコードがあります:

public class AboutActivity extends Activity{

    WebView aboutwebview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.edit_profile_settings);

        aboutwebview = (WebView) findViewById(R.id.aboutwebview);
        aboutwebview.setHorizontalScrollBarEnabled(false);
        aboutwebview.loadUrl("file:///android_asset/pickld.html");
    } 

}

ここにxmlファイルがあります:

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

    <LinearLayout
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:background="#7fad33"
        android:gravity="center"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/tv0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:text="Our Team"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#fff" />
    </LinearLayout>

    <WebView
        android:id="@+id/aboutwebview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

htmlそして、ファイルがアセットフォルダーにあることを確信しています。マニフェストファイルにもアクセス許可を設定しましたが、アプリケーションを実行すると、問題が次の行にあるという強制終了エラーが表示されます:

aboutwebview.loadUrl("file:///android_asset/pickld.html");

何が問題なのだろうと思っています。

logcat エラーは次のとおりです。

ここに画像の説明を入力

4

1 に答える 1