I am opening a link which is not part of my domain, let's say Using this piece of code
<a href="http://www.google.com" id="google"> <img src="images/google.png" ></a>'
Now when the user clicks this, my app redirects to google. I am trying to use the hardware back button on android to go back to my application.
When i press the back button, i get this message on logcat: 10-20 19:54:21.375: E/Web Console(29676): Uncaught ReferenceError: cordova is not defined at :1
What i have been able to understand from this is that when the link is redirected to google, our app has lost control of the phonegap. Is it so?
I have tried using data-rel="external"
with this link. But it doesn't makes any difference...
Following this, I have two problems i need help with
- When user presses hardware back button, go back to my app.
- When the google.com page is loading, user sees the page loading widget.
Take a look at the Phonegap ChildBrowser plugin, it could help you with your problem, here an excerpt: