简体   繁体   中英

Is there a way to check the url of a webview after every click? Android Studio

I want to make a webview that checks after every click if the url is still the same. If the url is not the same then the app should close. Is this possible with a webview?

That would be a weird way to do it. Instead, you should just override the WebViewClient's shouldInterceptRequest and shouldOverrideUrlLoading to disallow any requests to URLs you don't want to allow, so they can't leave your app.

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