0

I have gone through quite an obstacle working with this first app. I developed it in Dreamweaver using PhoneGap Build. After many tests and revisions I finally had it working properly then I had to sign it so I had to import everything into eclipse and now my exit functionality is not working. Below is the snippet I am currently using to close my app but after moving this into eclipse it no longer works. Can anyone tell me how to get the exit button (anchor) to exit when clicked? Or even the app to exit when user presses the home screen? Currently testing on Android.

<script type="text/javascript">
$(document).ready(function() {
 $('a.exit').click(function() {

     localStorage.clear(); 
     navigator.app.exitApp();

     return true;
});
});
</script>

...

<a href="#" class="exit" data-role="button" onclick="navigator.app.exitApp()">Exit Game</a>

It would also be ideal if I could use the native menu button on dock to have an exit option.. Again I had this working before importing into eclipse. Currently if you press the menu button on your android then you see a "settings" button but it doesnt do anything or go anywhere and I cant find where to control whats in there.

4

0 回答 0