My webapp at some point during its loading makes a request to a url which is callback:// in order to trigger a function in my android app.
I'm trying to catch this request with shouldOverrideUrlLoading
but it's not called.. any ideas?
Is it the non-standard url scheme causing this?
This is what they say in the shouldOverrideUrlLoading reference
Give the host application a chance to take over the control when a new url is about to be loaded in the current WebView. If WebViewClient is not provided, by default WebView will ask Activity Manager to choose the proper handler for the url. If WebViewClient is provided, return true means the host application handles the url, while return false means the current WebView handles the url. This method is not called for requests using the POST "method".
What's more important is what they don't say. The method will be called only when the user taps a link inside the Webview. You shound like you are calling the loadUrl() method in the WebView with your code. That does not result in a call to shouldOverrideUrlLoading. So that's what you are seeing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With