0
外部リンクがクリックされた場合、外部リンクがロードされた別のウェブビューに移動するウェブビューを作成しました。私はバックボタンをクリックすると、それがナビゲートされるページに戻るようにしたいと思っていました。たとえば、メインWebviewの4ページ目から外部リンクwebviewに移動した場合、それをクリックすると4ページ目に戻り、1ページ目には戻りません。これは参照用の私のXMLページです。あるウェブビューから別のウェブビューへの移動
<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/activity_main_webview"/>
<WebView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="45dp"
android:id="@+id/external_webview">
</WebView>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:id="@+id/ext_link"
android:layout_height="fill_parent">
<RelativeLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:background="#FFFFFF"
android:layout_height="45dp"
android:weightSum="1">
<Button
android:id="@+id/backtonews"
android:layout_marginTop="7dp"
android:layout_width="190dp"
android:layout_height="30dp"
android:background="@drawable/button">
</Button>
<Button
android:id="@+id/refresh"
android:layout_marginTop="7dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/refresh"
android:layout_alignParentRight="true"
android:singleLine="false">
</Button>
</RelativeLayout>
私はバック機能を書き込めませんでした。あなたは私にそれを行う方法の詳細を共有できますか? here' '' //行う作業 ; '' super.onBackPressed() がOverride' @ 'ます。public void(onBackPressed'){:onBackPressedメソッドをオーバーライドすることで押されたときにバックキー –
は、必ず手動操作を行うことができます'}' –
私は通常のバック機能を書くことができますが、最後のページを格納する方法を知りたいのですが、最初のWebビューではコード –