0

When I navigate to a second page and try to go back using the default back button that every android device has, it seems as though the first time I tap it, nothing happens. I have to tap it a second time. Anyone have any idea why this happens?

I'm not sure what more information I need to provide. If you need more info please request specifically what you need and I will try to edit the question.

Edit: my main activity extends DroidGap and only has the one method

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.loadUrl("file:///android_asset/www/index.html");
}

I think I'm narrowing down on the problem. On the second page, there are a list of anchor tags that perform a css animation when clicked.

This jsfiddle isn't doing the animation for whatever reason but here is the relevant markup, css and javascript

http://jsfiddle.net/7fdQu/

Farzad A
  • 578
  • 1
  • 5
  • 15

1 Answers1

0

I am not sure what is going on in background but there is a definite for it ....

you can program the back button in Android there is a code for it. The phonegap fires a event "backbutton" in Android.

document.addEventListener("backbutton", onBackKeyDown, false);

function onBackKeyDown() {
    window.location.href = 'URL';
} 

Ref:

  1. Should I use window.navigate or document.location in JavaScript?
  2. http://docs.phonegap.com/en/1.0.0/phonegap_events_events.md.html#backbutton
Community
  • 1
  • 1
Varun Agarwal
  • 299
  • 3
  • 12