cordova-android icon indicating copy to clipboard operation
cordova-android copied to clipboard

JS event 'resume' on Android 11 doesn`t work correctly during app start

Open WiHa31 opened this issue 3 years ago • 2 comments

Issue Type

  • [x] Bug Report
  • [ ] Feature Request
  • [ ] Support Question

Description

In my case: When app runnig at first time after installation, callback into event listener on 'resume' event, doesn`t work.

Information

In my code i added evnetListener on window.document, with params ('resume', onResume, false ) and in case witch is described above, callback onResume doesn`t work. Reproducibility of case is constant. Problem appeared only at Android 11, same code work correctly at Android with lower os version. IOS working correctly.

Case:

  1. Install app
  2. Launch app
  3. Hide(minimize) app
  4. Tap on app icon again Result: callback doesnt work

You can repeat this case and there will be the same result while your app is on memory. After unloading app from memory, and restart app problem dissapear.

When i change window.document.addEventListener('resume', ...) to window.document.onresume(...) - the problem continued.

Command or Code

const onResume = () => alert('resume event'); window.document.addEventListener('resume', onResume, false);

Environment, Platform, Device

Samsung Galaxy S20 Ultra, 11 Android - working incorrect Samsung Galaxy A52, 11 Android - working incorrect

Nokia TA-1053, 10 Android - working correct Samsung Galasy s9, 10 Android - working correct iPhone 11, IOS 12.1 - working correct

Version information

Android 11 Cordova 10.0.0

Checklist

  • [x] I searched for already existing GitHub issues about this
  • [ ] I updated all Cordova tooling to their most recent version
  • [x] I included all the necessary information above

WiHa31 avatar Feb 14 '22 13:02 WiHa31

https://github.com/apache/cordova-android/issues/1319 https://github.com/apache/cordova-android/issues/1340 looks like something same

WiHa31 avatar Feb 14 '22 13:02 WiHa31

Can you confirm if your issue also reproduces on an Android 11 emulator?

breautek avatar Feb 14 '22 13:02 breautek