Jon
Jon

Reputation: 6541

back button function for phonegap windows phone 7

How do I get the back button from Windows phone to work with PhoneGap 1.2?

Now what the back button does is exit the app.

There is a good post I dont understand or get to work by one of the SO editors: http://www.scottlogic.co.uk/blog/colin/2011/11/handling-the-back-stack-in-windows-phone-7-phonegap-applications/ but I dont understand it and I cant get it to work. (even the sample .sln has an error for me)

My app is a very simple structure of index.html and many html does that come off that one page, so if all the back button did was goto index.html, that would probably work for me.

Is there a solution for idiots? For example - add this framework but only to specific pages. Put this code here, and that code there, and those pages dont need anything. Something like that?

Upvotes: 2

Views: 1219

Answers (1)

ColinE
ColinE

Reputation: 70142

I have recently published a more simple example for back-button handling in applications that contains simple HTML pages:

http://www.scottlogic.co.uk/blog/colin/2011/12/a-simple-multi-page-windows-phone-7-phonegap-example/

In essence, there is some C# code that keeps track of when the browser navigates from one page to another, handling the back-button event in an appropriate fashion. Just drop your code into the www directory and it should work fine.

Upvotes: 2

Related Questions