Webview navigation into nativscript, interacting with back button


Having a page that only containes a webview.

<Page xmlns="http://www.nativescript.org/tns.xsd" actionBarHidden="true">

    <WebView src="http://example.com/" />


press the android back button. Then instead of navigating to the last page inside the webview, the app exits.

how can i solve this ? using Javascript


Got the solution from here: