cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julio cesar sanchez <jcesarmob...@gmail.com>
Subject [proposal] [ANDROID] move inAppBrowser intents from onPageStarted to shouldOverrideUrlLoading
Date Thu, 02 Apr 2015 23:07:08 GMT
I've been looking into issues and I have seen this one:
https://issues.apache.org/jira/browse/CB-8180

Right now the code to handle the tel links is inside the onPageStarted

if (url.startsWith(WebView.SCHEME_TEL)) {
                try {
                    Intent intent = new Intent(Intent.ACTION_DIAL);
                    intent.setData(Uri.parse(url));
                    cordova.getActivity().startActivity(intent);
                } catch (android.content.ActivityNotFoundException e) {
                    LOG.e(LOG_TAG, "Error dialing " + url + ": " +
e.toString());
                }
            }

But the problem is, it launchs the intent and try to open the web page, so
when you come back from the intent you see a "couldn't load the url" page
on the app.

I've tried to use the view.stopLoading() but it doesn't seem to stop it.
The issue only talks about the tel links, but I suppose that will happen
with sms, mailto and some other links.


So, I think a solution might be to move that code to
shouldOverrideUrlLoading function.

Is there any reason of doing this on the onPageStarted instead of using the
shouldOverrideUrlLoading?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message