简体   繁体   中英

ActivityNotFoundException: No Activity found to handle Intent { act= dat="url"

I received a log during debugging
He appeared on some mobile phones, and I don't know how to make it reappear
The following is the error log and source code oh,This link points to an advertisement
But I didn't open the ad
I suspect it's advertising on the web
and act is null! I don't understand

android.content.ActivityNotFoundException: No Activity found to handle Intent { act= dat=https://mob66.bbzwonline.com/... }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2066)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1720)
    at android.app.Activity.startActivityForResult(Activity.java:5258)
    at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:676)
    at android.app.Activity.startActivityForResult(Activity.java:5216)
    at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:663)
    at android.app.Activity.startActivity(Activity.java:5587)
    at android.app.Activity.startActivity(Activity.java:5555)
    at com.ruifenglb.www.ad.AdWebView$1.shouldOverrideUrlLoading(AdWebView.java:55)
    at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:83)
    at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(chromium-TrichromeWebViewGoogle.apk-stable-410410183:16)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:336)
    at android.os.Looper.loop(Looper.java:181)
    at android.app.ActivityThread.main(ActivityThread.java:7562)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

code

@SuppressLint("SetJavaScriptEnabled")
    private void initSetting() {
        addJavascriptInterface(new AdJavascriptInterface(), "AdJavascriptInterface");
        setWebViewClient(new WebViewClient() {
            @Override
            public void onPageFinished(WebView webView, String s) {
                webView.loadUrl("javascript:(" + jsimg + ")()");
                EventBus.getDefault().postSticky(new CloseSplashEvent());
            }

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                Uri uri = Uri.parse(url);
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                getContext().startActivity(intent);
                return true;
            }

        });

        WebSettings webSettings = getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setUseWideViewPort(true);
        webSettings.setLoadWithOverviewMode(true);
        webSettings.setLoadsImagesAutomatically(true);
    }

Check if device has any app that can handle url

Kotlin

if (resolveActivity(packageManager) != null) {
        Uri uri = Uri.parse(url);
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        getContext().startActivity(intent);
        return true;
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM