Untitled

mail@pastecode.io avatar
unknown
java
3 years ago
883 B
5
Indexable
Never
url = "gojek://gopay/merchanttransfer?tref=0120210507083906HXVFklA2mIID&amount=146000&activity=GP:RR&callback_url=someapps%3A%2F%2Fcallback%3Forder_id%3DIDORD%257B20210507033922%257D";

        binding.webView.getSettings().setJavaScriptEnabled(true);

        binding.webView.setWebViewClient(new WebViewClient() {

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                Log.d("TAG", "shouldOverrideUrlLoading: "+ url);
                Intent intent;

                if (url.contains(url)) {
                    intent = new Intent(Intent.ACTION_VIEW);
                    intent.setData(Uri.parse(url));
                    startActivity(intent);

                    return true;
                }
                return false;
            }

        });

        binding.webView.loadUrl(url);