I have developed an application in phoneGap Android.
In my App back button is not working properly.
I used this code to navigate the form:
document.addEventListener("backbutton", handleBackButton, true);
function handleBackButton()
{
if (typeof(navigator) != 'undefined' && typeof(navigator.app) != 'undefined' && typeof(navigator.app.backHistory) == 'function')
{
history.go(-1);
navigator.app.backHistory();
}
else
{
history.go(-1);
//navigator.app.backHistory();
}
}
its working is as following:
for example i have three page a.html
, b.html
, c.html
I'm navigating from a.html
to b.html
to c.html
issues
when i click back button, it navigate from c.html
to b.html
,
again the process is repeat, it wont go to a.html
.