【问题标题】:I have a problem with a PHP form on an iframe on my Android Webview我的 Android Webview 上 iframe 上的 PHP 表单有问题
【发布时间】:2019-04-01 15:17:05
【问题描述】:

我有一个 php 登录表单在移动浏览器上完美运行,但在我的 web 视图中,当用户按下提交按钮时页面刷新。

【问题讨论】:

    标签: android webview


    【解决方案1】:

    “页面刷新”是什么意思?有一个空白页或没有任何反应? 您可以像这样拦截并继续进行深层链接(例如:您的 webview 中的链接):

      myWebView.setWebViewClient( new WebViewClient()
                {
    
                @SuppressWarnings("deprecation")
                @Override
                public boolean shouldOverrideUrlLoading(WebView inView, String inUrl)
                    {
                    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse( inUrl ) );
                    inView.getContext().startActivity(intent);
                    return true;
                    }
    
                @TargetApi(Build.VERSION_CODES.N)
                @Override
                public boolean shouldOverrideUrlLoading( WebView inView, WebResourceRequest inRequest )
                    {
                    Intent intent = new Intent(Intent.ACTION_VIEW, inRequest.getUrl());
                    inView.getContext().startActivity(intent);
                    return true;
                    }     
                } );
    

    【讨论】:

    猜你喜欢
    • 2012-02-21
    • 2013-02-17
    • 1970-01-01
    • 1970-01-01
    • 2014-10-19
    • 1970-01-01
    • 2011-03-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多