Hi,
Thanks using Crosswalk.
I have tested on Android WebView, it has the same result with xwalk.
I think you can't use this API like that, because "return
super.shouldOverrideUrlLoading(xWalkView,newUrl);" will actually call below:
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return false;
}
So the newUrl is valid.
You can use it like below, it should works well:
@Override
public boolean shouldOverrideUrlLoading(XWalkView view, String url)
{
Log.i(LOGTAG, "shouldOverrideUrlLoading ");
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(injectIsParams(url))));
return true;
}
});
Best Regards :)
Xiaofeng Zhang
From: Crosswalk-help
[mailto:[email protected]] On Behalf Of
Vincent AROD
Sent: Wednesday, May 04, 2016 8:49 PM
To: [email protected]
Subject: Re: [Crosswalk-help] Android - override url in order to add parameters
Hi again,
I've also tested in the latest release version v18 and I got the same result.
If you have any idea :)
Vincent.
________________________________
De : Vincent AROD
Envoyé : mercredi 4 mai 2016 11:23:54
À :
[email protected]<mailto:[email protected]>
Objet : Android - override url in order to add parameters
Hello all,
we are using xwalk core apis in our project in order to get a better android
webview than os native version. Thanks you for this great project.
I would like to add parameters in url to setup the site ?numMag=XXX
on standard android webview we are using shouldOverrideUrlLoading to change url
and return the parent method
We try do the same in xwalk with shouldOverrideUrlLoading and
shouldInterceptLoadRequest in XWalkResourceClient but it doesn't override url.
Here is the piece of code :
if (mOverride) {
Uri.Builder builder = Uri.parse(url).buildUpon();
builder.appendQueryParameter("numMag", mNumSite);
String newUrl = builder.build().toString();
Log.d("Override", newUrl);
}
return super.shouldOverrideUrlLoading(xWalkView,newUrl);
what is expected is that the webview loads url + "?numMag=XXX" but it loads
only original url.
do you have any idea ?
we are working with v16 (yeap an old one)
Thanks you.
Vincent.
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help