This is a migrated thread and some comments may be shown as answers.

Link to external site using Android browser not working

1 Answer 111 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jan-Dirk
Top achievements
Rank 1
Jan-Dirk asked on 17 Aug 2012, 05:09 PM
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?

1 Answer, 1 is accepted

Sort by
0
Jan-Dirk
Top achievements
Rank 1
answered on 17 Aug 2012, 07:36 PM
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.
Tags
Report a bug
Asked by
Jan-Dirk
Top achievements
Rank 1
Answers by
Jan-Dirk
Top achievements
Rank 1
Share this question
or