incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-955) CordovaWebViewClient shouldOverrideUrlLoading method not called upon a redirect
Date Fri, 20 Jul 2012 22:53:34 GMT

     [ https://issues.apache.org/jira/browse/CB-955?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joe Bowser updated CB-955:
--------------------------

    Fix Version/s: 2.1.0
    
> CordovaWebViewClient shouldOverrideUrlLoading method not called upon a redirect
> -------------------------------------------------------------------------------
>
>                 Key: CB-955
>                 URL: https://issues.apache.org/jira/browse/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
>             Fix For: 2.1.0
>
>
> Summary
> -------
> 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
WebViewClient.
> - 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. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>     	try{
>     	super.onCreate(savedInstanceState);
>         super.init();
>         super.appView.clearCache(true);
>         super.appView.clearHistory();
>         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);
>   }
> });
> super.loadUrl(("http://google.com");
> Actual behavior
> ---------------
> The following is logged:
> INFO/BugTest(14658): onPageStarted: http://google.com/
> INFO/BugTest(14658): onPageStarted: http://www.google.com/
> INFO/BugTest(14658): onPageFinished: http://www.google.com/
> Expected Behavior
> -----------------
> On devices running with cordova 1.8.1 (Android OS version 4.0), the following is logged:
> INFO/BugTest(11447): onPageStarted: http://google.com/
> INFO/BugTest(11447): onPageStarted: http://www.google.com/
> INFO/BugTest(11447): shouldOverrideUrlLoading: http://www.google.com/
> INFO/BugTest(11447): onPageFinished: http://www.google.com/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message