cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vaduganathan (JIRA)" <>
Subject [jira] [Created] (CB-955) CordovaWebViewClient shouldOverrideUrlLoading method not called upon a redirect
Date Mon, 25 Jun 2012 10:22:44 GMT
Vaduganathan created CB-955:

             Summary: CordovaWebViewClient shouldOverrideUrlLoading method not called upon
a redirect
                 Key: CB-955
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 1.8.1
         Environment: - Android 4.0 emulator running in windows machine as well in iOS machine
- Android 2.3 device.
            Reporter: Vaduganathan
            Assignee: Joe Bowser

in Cordova v 1.8.1 a DroidGap.appview's CordovaWebViewClient.shouldOverrideUrlLoading method
is not called when that appview loads a URL that results in a redirect.

To reproduce
- create a DroidGap activity and set instance of CordovaWebViewClient as DroidGap.appview's
- override shouldOverrideUrlLoading
- have the DroidGap.appview load a URL that redirects to another page

Sample code (from within an Activity subclass):

public class HelloPhoneGapActivity extends DroidGap {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {

        this.appView.setWebViewClient(new CordovaWebViewClient(this){

        public boolean shouldOverrideUrlLoading(final WebView view, String url) {
    Log.i("BugTest", "shouldOverrideUrlLoading: " + url);
    return true;

  public void onPageStarted(WebView view, String url, Bitmap favicon) {
    Log.i("BugTest", "onPageStarted: " + url);

  public void onPageFinished(WebView view, String url) {
    Log.i("BugTest", "onPageFinished: " + url);

Actual behavior
The following is logged:

INFO/BugTest(14658): onPageStarted:
INFO/BugTest(14658): onPageStarted:
INFO/BugTest(14658): onPageFinished:

Expected Behavior
On devices running with cordova 1.8.1 (Android OS version 4.0), the following is logged:

INFO/BugTest(11447): onPageStarted:
INFO/BugTest(11447): onPageStarted:
INFO/BugTest(11447): shouldOverrideUrlLoading:
INFO/BugTest(11447): onPageFinished:

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message