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

ListView hang after opening external link on native browser

2 Answers 96 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Ralph
Top achievements
Rank 1
Ralph asked on 19 Feb 2013, 09:26 AM
In a ListView, a script to open an external link by native browser is called when a link is clicked. 

On Android:
navigator.app.loadUrl(link,  { openExternal:true } );
On iOS:
window.open(link, '_system');

The link can be opened on the corresponding native browser. 

When the user try to switch back to the app, some problems happen after that. 

On Android, the screen hung on the original view, when the back button is pressed again, the screen is un-freezed and can be refreshed.

On iOS, however, the screen is also hung on the original view. When tapped on the screen, the complete view (with the layout) is moved. There is no way to un-freeze this screen.

How to fix this so that the screen can be un-frezzed after switching back from the native browser to the app?

Thank you very much for your help.

2 Answers, 1 is accepted

Sort by
0
Ralph
Top achievements
Rank 1
answered on 20 Feb 2013, 06:09 AM
After changing the original <a> DOM to <span>, everythings work as expected. 
But still want to have an answer about this issue.
0
Alexander Valchev
Telerik team
answered on 21 Feb 2013, 08:24 AM
Hello Ralph,

I tried to reproduce the behaviour that you described on iPhone and phone with Android 4.1.2 but to no avail. Here is the code that I used:
function onClick() {
    if (kendo.support.mobileOS.android) {
        navigator.app.loadUrl("http://www.google.com", { openExternal:true } );
    }
    if (kendo.support.mobileOS.ios) {
        window.open("http://www.google.com", '_system');
    }
}
<div id="home" data-role="view" data-title="home">
    <ul id="listview" data-role="listview" data-style="inset">
        <li>item 1</li>
        <li>item 2</li>
        <li>item 3</li>
    </ul>
    <a data-role="button" data-click="onClick">Open</a>
</div>

Could you please provide more details or if possible a sample project? Which iOS and Android version you use for testing? What triggers the function that opens the external link?

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView (Mobile)
Asked by
Ralph
Top achievements
Rank 1
Answers by
Ralph
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or