Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9135983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:53:36+00:00 2026-06-17T08:53:36+00:00

I have a phonegap app that requires I capture the back button. This works

  • 0

I have a phonegap app that requires I capture the back button. This works swimmingly but when I am at the main screen and the back button is pressed I want to call the original event handler and let the app close or do whatever comes naturally to the platform with such a press. I know I can tell the app to quit but understand this is bad form for iPhone apps.

No matter what I try (and I have tried many things) I cannot get the original handler to fire. Any advice?

In my code I have a switch statement inside my backbutton event handler that directs the app as needed to the effect of:

switch blahBlah
{
    case 'this' :
        doThis() ;
        break;
    case 'main' :
        // What do I do here that is well behaved for all platforms??? 
        break;
    default:
        doFoo() ;
} 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:53:37+00:00Added an answer on June 17, 2026 at 8:53 am

    Detect whenever you land on the main screen and remove your custom event handler.

    document.removeEventListener( "backbutton", function(){}, false );
    

    and add the event listener on the other pages (or sections).

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

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that is generated by Phonegap. it works fine, but I
I have an PhoneGap iOS app and have this HTML that won't show the
I have a phonegap app that uses jqm that works fine in android and
I have created a minimal PhoneGap app that has just this in the index.html:
We've put together an app that is mostly working in phonegap. We have an
I am building a PhoneGap/Cordova app and have a simple code that uses http://ricostacruz.com/jquery.transit/
I've developed an iPad app using PhoneGap that requires users to log in. Will
Phonegap 2.1 iOS 6 jQuery 1.7.2 JQMobile 1.1.1 I have a phonegap app that
I have a PhoneGap app that I'm testing on webOS, Android, and iPhone. I'm
I have a Phonegap Android app that scans RFID chips. Apparently scanning RFID does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.