Link to external site using Android browser not working

2 posts, 0 answers
  1. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 17 Aug 2012 Link to this post

    I have links to an external site in my App. They work as expected in the emulator (a new window opens on top of the emulator), but on my device they are opened in the App itself.

    How can I make sure that the default Android browser (Firefox in my case) is used?
  2. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 17 Aug 2012 Link to this post

    It seems that this is working different for Android and iOS, but since I have no iOS device, I cannot confirm that.

    Anyway, I solved it this way:

    For the url's I used the onclick(); event: <a href="#" onclick('openUrl(\'www.google.com\');return false;)>link text</a>

    function loadUrl is like this:
    function openUrl(url) {
        navigator.app.loadUrl(url, { openExternal:true } );
    }

    The sample above works on Android.
Back to Top