当我尝试实施此Paypal按钮时,收到Chrome停止错误

时间:2019-01-31 00:07:21

标签: java android android-studio paypal android-webview

我正在尝试使用贝宝付款方式,我确实需要帮助。我没有使应用程序崩溃,但是单击了付款按钮。我从chrome收到此错误。

Make_payment.java

package com.rough.tuber.tuber;

import android.graphics.Bitmap;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.Toast;

public class Make_Payment extends AppCompatActivity {
private WebView mWebView;
private ProgressBar mProgress;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_make__payment);
        mWebView = (WebView) findViewById(R.id.mWebView);
        mProgress = (ProgressBar) findViewById(R.id.progressBar);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        mWebView.setWebViewClient(new WebViewClient(){
            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon){
                super.onPageStarted(view,url,favicon);
                mWebView.setVisibility(View.GONE);
                mProgress.setVisibility(View.VISIBLE);
                if (url.equals("https://www.tata.com/")){
                    Toast.makeText(Make_Payment.this, "payment is cancelled",Toast.LENGTH_SHORT);
                    finish();
                }
                else if (url.equals("https://www.tata.com/done")){
                    Toast.makeText(Make_Payment.this, "payment is success",Toast.LENGTH_SHORT);
                    youCanDoWhateverDoYouWantToDo();
                }
            }



            @Override
            public void onPageFinished(WebView view , String url){
                super.onPageFinished(view,url);
            }
                                  }



        );
mWebView.loadUrl("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SEQMAH2ZWEAV8");
    }
    private void youCanDoWhateverDoYouWantToDo() {
    }


}

这是屏幕截图enter image description here

0 个答案:

没有答案