开发者

WebView - can a custom listener be set up for handling a webpage-forwarding action?

In my app, I have to display a specific webpage in a WebView that handles payment. The user has to mess around in this page,开发者_如何学运维 and if the transaction was successful, the webpage will initiate a forwarding to a specific url. I have to intercept this forwarding call in the android app, and handle it properly.

Is this possible? I haven't found any methods on WebView that can bind a listener to handle a forwarding action.

Thanks


Can you detect forwarding in here:

webview.setWebViewClient(new WebViewClient() {  
   public boolean shouldOverrideUrlLoading(WebView view, String url)  {                  

                //handle stuff here 
                //e.g. view.loadUrl(url);   
                return true;    
            }

            public void onPageFinished(WebView view, String url) {
                //dismiss the indeterminate progress dialog
                Log.d(TAG, "onPageFinished: " + url);
                dismissMyDialog();                
            } 
        });  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜