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


   # Bug Report
   
   ## Problem
   
   ### What is expected to happen?
   Cordova should silently exit.
   
   
   ### What does actually happen?
   Cordova crashes because the parent Activity is not alive anymore
   
   
   ## Information
   <!-- Include all relevant information that might help understand and 
reproduce the problem -->
   Start a CordovaWebview and load a slow/large website.
   
   `cordovaWebView.loadUrl(url)`
   
   If you return to the previous activity (by using the (hardware) back 
button), cordova will try to execute `cordova.getActivity().runOnUiThread()`, 
but the activity is no longer there.
   
   e.g., 
https://github.com/apache/cordova-android/blob/master/framework/src/org/apache/cordova/CordovaWebViewImpl.java#L187
   
   Stacktrace:
   ```
   java.lang.NullPointerException: Attempt to invoke virtual method 'void 
android.app.Activity.runOnUiThread(java.lang.Runnable)' on a null object 
reference
           at 
org.apache.cordova.CordovaWebViewImpl$2.run(CordovaWebViewImpl.java:179)
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
           at java.lang.Thread.run(Thread.java:764)
   ```
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   See information above on how to reproduce.
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   Android / All devices / All OS
   
   
   ### 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.
   -->
   Android Studio 
   Cordova 8.1.0
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [X ] I searched for existing GitHub issues:
   - Found issue: https://github.com/apache/cordova-android/issues/884 but this 
was closed due to lack of information
   - [X] I updated all Cordova tooling to most recent version:
   - Crash occured on 
       'org.apache.cordova:cordova:6.2.3'
   Updated to (crashed as well):
       'org.apache.cordova:framework:8.1.0'
   - [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.

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