CodeWithOz opened a new issue #1282:
URL: https://github.com/apache/cordova-android/issues/1282


   # Bug Report
   
   ## Problem
   The app's background color regularly flashes over the contents of the app 
when I resume the app from the background
   
   ### What is expected to happen?
   The app resumes without such a flash
   
   
   ### What does actually happen?
   See the problem statement
   
   
   ## Information
   <!-- Include all relevant information that might help understand and 
reproduce the problem -->
   
   
https://user-images.githubusercontent.com/28525986/125789780-476eac7a-e616-40ac-af23-51fa78aa5574.mp4
   
   
   In the video above, the white is the normal app content, and the green is 
the background color of the app (not the DOM, the Android view itself). You can 
see that as I return the app to the foreground from the app switcher, there's a 
brief period where the green color overrides the white. I used those 2 colors 
just to highlight the bug, but the problem is the same with the app's actual 
contents i.e. when I return to the app, the app's background (white in my case) 
flashes over the app's contents (i.e. the DOM). I'm not sure what's going on, 
it looks it's something happening with the webview itself. I am fairly certain 
it's not a style invalidation problem because style invalidations or repaints 
of the DOM don't show up when I profile the bug using dev tools. In fact in dev 
tools, the DOM is never repainted and there's no flash. Things I've tried:
   - disabling the `onDeviceResume` and `onDevicePause` callbacks. When I say 
disable I mean that I put return; statements to make sure that those callbacks 
don't execute any logic. This didn't stop the problem
   - using a transparent app background color. I thought this would allow the 
app's contents to show even when the background color is overlaying the 
contents, but instead it only made the flash dark (i.e. no background color for 
the app to show). This suggests that something is actually removing and 
restoring the Android view, but I don't know how to check for this
   - removing all the contents of the DOM (i.e. setting `display: none;` to all 
visible content, and also to the `<html>` and `<body>` elements in another 
test). This essentially hides everything on screen, leaving only the app's 
background. In my video, that would mean only the green would be showing. The 
flash doesn't happen when I do this, perhaps unsurprisingly
   - removing some of the heavier plugins I use, particularly [this background 
geolocation 
plugin](https://github.com/transistorsoft/cordova-background-geolocation-lt/) 
and the [the google maps 
plugin](https://github.com/mapsplugin/cordova-plugin-googlemaps/), but the 
problem doesn't go away
   - using the basic cordova sample app to try to reproduce the problem but I 
haven't succeeded yet, the bug hasn't occurred
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   N/A, please see the description above
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   - cordova android: versions 9 and 10
   - device: Tecno Pop2 Plus
   
   
   ### Version information
   <!--
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   - cordova CLI: 10
   - plugins:
     - branch-cordova-sdk 3.2.0 "branch-cordova-sdk"
     - cordova-android-support-gradle-release 3.0.1 
"cordova-android-support-gradle-release"
     - cordova-plugin-android-notch 1.0.0 "AndroidNotch"
     - cordova-plugin-android-permissions 1.0.2 "Permissions"
     - cordova-plugin-camera 4.1.0 "Camera"
     - cordova-plugin-compat 1.2.0 "Compat"
     - cordova-plugin-contacts 3.0.1 "Contacts"
     - cordova-plugin-device 2.0.3 "Device"
     - cordova-plugin-enable-multidex 0.2.0 "Enable Multidex"
     - cordova-plugin-file-transfer 1.7.1 "File Transfer"
     - cordova-plugin-file 6.0.2 "File"
     - cordova-plugin-googleplus 5.3.2 "Google SignIn"
     - cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
     - cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
     - cordova-plugin-ionic-webview 2.5.1 "cordova-plugin-ionic-webview"
     - cordova-plugin-ios-camera-permissions 1.2.0 "iOS Permissions"
     - cordova-plugin-media-capture 3.0.3 "Capture"
     - cordova-plugin-network-information 2.0.2 "Network Information"
     - cordova-plugin-purchase 9.0.0 "Purchase"
     - cordova-plugin-splashscreen 5.0.3 "Splashscreen"
     - cordova-plugin-video-editor 1.1.3 "VideoEditor"
     - cordova-plugin-whitelist 1.3.4 "Whitelist"
     - cordova-plugin-x-socialsharing 5.6.3 "SocialSharing"
     - cordova-sqlite-storage 5.0.0 "Cordova sqlite storage plugin - 
cordova-sqlite-storage plugin version"
     - cordova.plugins.diagnostic 5.0.1 "Diagnostic"
     - es6-promise-plugin 4.2.2 "Promise"
     - pushwoosh-cordova-plugin 7.18.7 "Pushwoosh"
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to