首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从一个one视图导航到另一个one视图

问从一个one视图导航到另一个one视图
EN

Stack Overflow用户
提问于 2016-04-25 18:05:43
回答 1查看 129关注 0票数 0

我已经创建了一个网页视图,如果一个外部链接被点击,它就会转到另一个加载了外部链接的网页视图。我希望它的方式是,如果我的后退按钮被点击,它就会返回到它所在的页面。例如,如果我从主网页视图的第4页导航到某个外部链接网页视图,如果我单击“上一步”,它应该返回到第4页,而不是第1页。这是我的XML页面以供参考。

代码语言:javascript
复制
 <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>
EN

回答 1

Stack Overflow用户

发布于 2016-04-25 18:15:11

在进入第二个网页之前,你必须在第一个网页视图中存储最后一个网页,然后听back键,然后用保存的地址弹出第一个网页视图

如果你想知道更多细节,请告诉我。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36837514

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档