Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate from a webpage to local page in my phonegap app?

I have a phonegap app running on my phone. I have a link that takes me to a web page to check some info and presents some data... then I want to be able to have a back button so that the user will navigate back to the local app. Is this possible in both android and iOS?

like image 957
user969275 Avatar asked Feb 27 '12 07:02

user969275


3 Answers

I think you should use childbrowser plugin of phonegap as in that case you will have consistent behavior in both android and iOS considering iOS does not have backbutton to go back to the application.

Childbrowser for Android
Childbrowser for iOS

like image 162
dhaval Avatar answered Oct 16 '22 09:10

dhaval


This works in both Android and iOS:

window.history.go( -( history.length - 1 ) );

But, as others have mentioned, I've found it not worth it to try to ever leave the UIWebView. After you get back to your app page, things occasionally don't work as expected. I've noticed that PhoneGap gets unloaded and there appears to be no way to reload it.

like image 20
ThinkingStiff Avatar answered Oct 16 '22 08:10

ThinkingStiff


Answer is "NO WAY BACK".
You can navigate within your Local App (classes any number of times)
Once you send the flow to

        super.loadUrl("file:///android_asset/www/index.html");

You cannot Navigate back to any local class.

like image 41
VenomVendor Avatar answered Oct 16 '22 08:10

VenomVendor