Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13975

Android MainActivity cdvStartInBackground=true fails to fire pause event

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-android
    • Labels:
      None

      Description

      The MainActivity created from the template that adds support for starting the app in the background via the cdvStartInBackground flag doesn't fire the pause event. Debugging the Android code it looks like onPause is called before the messageChannel is set so the send event is dropped.

      There should probably be a pendingPause flag like the pendingResume.

      The reason this is a problem is that I am using the phonegap-push-plugin to wake the app in the background and I want to know that the app is in the background so I can disable polling requests which are a data and battery drain, currently I cannot do this and the app can just be sitting there in the background consuming resources it doesn't need.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bowserj Joe Bowser
                Reporter:
                richturner Rich T
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: