单击后退按钮停止WebView应用程序

时间:2015-09-06 18:07:48

标签: android webview

我为网站创建了一个WebView。我用过这个代码

{{1}}

所以我的问题是如果我点击应用程序停止的后退按钮

1 个答案:

答案 0 :(得分:0)

这是一种内置方法,因为您的解决方案从未奏效。

@Override
    public void onBackPressed()
    {
        super.onBackPressed();
        if(/*Check for a previous website*/)
        {
            //Put the code for previous website in here
        }
        else
        {
            //Put the code for finishing this Activity, or what else you want
        }
    }
相关问题