Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

WebView error event no firing in Android

I am more or less creating a wrapper program for a web app. I am trying to do some navigation and error handling with in the Titanium Native UI calls. I want to catch web errors such as 500 and 404 with in the Native UI to give better error messages then just a web error page. I have created a webView and added an event listener for the error event. On the iPhone the event fires, but on Android the event does not fire and I only get a page with in the webView that says "Web Page not Available". Has any one had any luck getting around this?

— asked December 6th 2010 by Kevin Berry
  • android
  • event.
  • mobile
  • webview
2 Comments
  • Posting some code might help you get a faster response

    — commented December 6th 2010 by Aaron Saunders
  • Here is the code I'm using to create the event listener.

    webView.addEventListener('error', 
            function(e) { 
                Titanium.API.info("Caught and error");
                Titanium.API.info(e.message);
                Titanium.API.info(e.type);
        });
    
    — commented December 6th 2010 by Kevin Berry

5 Answers

  • Bump.

    — answered August 1st 2011 by Justin Ferrell
    permalink
    0 Comments
  • There is still no error event being fired in a webView for Android. (which I really need to be able to catch)

    — answered December 10th 2011 by Kosso
    permalink
    0 Comments
  • Same issue

    — answered February 9th 2012 by San Pathak
    permalink
    0 Comments
  • same with me

    — answered May 15th 2012 by Kemalettin ERBAKIRCI
    permalink
    0 Comments
  • This has yet to be committed, but it will fix this issue, if you're happy to hack your own SDK:

    https://github.com/kosso/titanium_mobile/commit/7d098eb5147d6883017281f045266cac2f396e19

    — answered May 15th 2012 by Kosso
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.