I'm encountering an issue with my function that utilizes the back button on Android Phones. Instead of going back one page as intended, it's going back two pages.
Here is a snippet of my current code:
function onBackKeyDown()
{
currentPage = $.mobile.activePage.attr('id');
if(currentPage == "createUser")
{
$.mobile.changePage("#logIn");
alert("Return To Login Page");
currentPage = "";
}
// More conditions follow...
}
For instance, when I am in the `cardDetails` page and press the back button, it goes back to `createUser` and then continues back to `logIn`. I have tried resetting the `currentPage` variable and adding more conditional statements but the issue persists.
Requested Java Code:
import android.os.Bundle;
import org.apache.cordova.DroidGap;
public class FnBApp extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}
Any assistance on this matter would be highly appreciated.
Sincerely, John