[GitHub] cordova-plugin-splashscreen issue #130: CB-13094: (android) Don't show splas...

2017-07-28 Thread SharUpOff
Github user SharUpOff commented on the issue:

https://github.com/apache/cordova-plugin-splashscreen/pull/130
  
@filmaj, thank you for the prompt response! (:


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-splashscreen issue #130: CB-13094: (android) Don't show splas...

2017-07-26 Thread filmaj
Github user filmaj commented on the issue:

https://github.com/apache/cordova-plugin-splashscreen/pull/130
  
Confirmed that this patch fixes the crash. Merged it in.

Thanks for the contribution @SharUpOff! + on your first ever GitHub PR, too


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-splashscreen issue #130: CB-13094: (android) Don't show splas...

2017-07-26 Thread infil00p
Github user infil00p commented on the issue:

https://github.com/apache/cordova-plugin-splashscreen/pull/130
  
Going to about:blank is done as a garbage collection technique before 
closing out the WebView entirely so that the memory is freed.  There's a 
hilarious TODO here saying that it shouldn't destroy the WebView until 
about:blank is done loading.  

But yeah, I agree with the fix.  The Splashscreen shouldn't try to attach a 
UI element to the Activity while the Activity is basically killing itself on a 
backbutton, or some other exit event, and that's clearly what's causing this 
behaviour.  

Of course, if we never made this a plugin in the first place, we wouldn't 
have such a weird disconnect between this plugin and the platform code, so 
there is that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-splashscreen issue #130: CB-13094: (android) Don't show splas...

2017-07-26 Thread filmaj
Github user filmaj commented on the issue:

https://github.com/apache/cordova-plugin-splashscreen/pull/130
  
And @SharUpOff your intuition is confirmed: the logcat logs show that after 
pressing the back button in my app after loading it up, Cordova tries to load 
about:url:

```
07-26 12:59:40.652  9214  9214 D CordovaActivity: Stopped the activity.
07-26 12:59:40.652  9214  9214 D CordovaActivity: 
CordovaActivity.onDestroy()
07-26 12:59:40.653  9214  9214 D CordovaWebViewImpl: >>> 
loadUrl(about:blank)
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-splashscreen issue #130: CB-13094: (android) Don't show splas...

2017-07-26 Thread filmaj
Github user filmaj commented on the issue:

https://github.com/apache/cordova-plugin-splashscreen/pull/130
  
OK, I've been able to reproduce the behaviour - sort of. In my case, it 
wasn't that the my app showed the splashscreen, but that the app crashed while 
exiting!

My test app was a fresh cordova project with cordova-android 6.2.3 and 
cordova-plugin-splashscreen 4.0.3 added. I added nothing to the default cordova 
app code other than attaching `splashscreen.show()` to the `beforeunload` 
method, as per your above comment.

Here's my stack trace:

```
07-26 12:59:40.652  9214  9214 D CordovaActivity: Stopped the activity.
07-26 12:59:40.652  9214  9214 D CordovaActivity: 
CordovaActivity.onDestroy()
07-26 12:59:40.653  9214  9214 D CordovaWebViewImpl: >>> 
loadUrl(about:blank)
07-26 12:59:40.663  9214  9214 W cr_AwContents: WebView.destroy() called 
while WebView is still attached to window.
07-26 12:59:40.726  1162  5658 W WindowManager: Attempted to add 
application window with unknown token Token{760cced ActivityRecord{f0b0f04 u0 
io.cordova.hellocordova/.MainActivity t129 f}}.  Aborting.
07-26 12:59:40.727  9214  9214 D AndroidRuntime: Shutting down VM
- beginning of crash
07-26 12:59:40.728  9214  9214 E AndroidRuntime: FATAL EXCEPTION: main
07-26 12:59:40.728  9214  9214 E AndroidRuntime: Process: 
io.cordova.hellocordova, PID: 9214
07-26 12:59:40.728  9214  9214 E AndroidRuntime: 
android.view.WindowManager$BadTokenException: Unable to add window -- token 
android.os.BinderProxy@1012df7 is not valid; is your activity running?
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.view.ViewRootImpl.setView(ViewRootImpl.java:679)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.app.Dialog.show(Dialog.java:329)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
org.apache.cordova.splashscreen.SplashScreen$5.run(SplashScreen.java:318)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.app.Activity.runOnUiThread(Activity.java:5869)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
org.apache.cordova.splashscreen.SplashScreen.showSplashScreen(SplashScreen.java:281)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
org.apache.cordova.splashscreen.SplashScreen.onMessage(SplashScreen.java:189)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
org.apache.cordova.PluginManager.postMessage(PluginManager.java:312)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
org.apache.cordova.CordovaWebViewImpl.postMessage(CordovaWebViewImpl.java:377)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
org.apache.cordova.splashscreen.SplashScreen$3.run(SplashScreen.java:169)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.os.Handler.handleCallback(Handler.java:751)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.os.Handler.dispatchMessage(Handler.java:95)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.os.Looper.loop(Looper.java:154)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
android.app.ActivityThread.main(ActivityThread.java:6121)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
java.lang.reflect.Method.invoke(Native Method)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
07-26 12:59:40.728  9214  9214 E AndroidRuntime:at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
```

This was on a Google Pixel running Android 7.1.2.

Next up I'll test out your patch and see how the behaviour differs.

FYI @infil00p.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-splashscreen issue #130: CB-13094: (android) Don't show splas...

2017-07-26 Thread filmaj
Github user filmaj commented on the issue:

https://github.com/apache/cordova-plugin-splashscreen/pull/130
  
Ah, great! Thanks for describing that. I will take a look at that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-splashscreen issue #130: CB-13094: (android) Don't show splas...

2017-07-25 Thread SharUpOff
Github user SharUpOff commented on the issue:

https://github.com/apache/cordova-plugin-splashscreen/pull/130
  
I got it so:
```javascript
window.addEventListener('beforeunload', function()
{
navigator.splashscreen.show();
});
```
I show splash when reload my application without restarting cordova in some 
cases (language switching, debug mode, etc). Closing by "back" button fires 
"beforeunload" (to "about:blank" i think) and showing splash in same time 
activity being finished. Also i use crosswalk, maybe it fires "beforeunload", 
not the native WebView.

Trace here:

```java
FATAL EXCEPTION: main
Process: scat.su.calltaxi, PID: 16999
android.view.WindowManager$BadTokenException: Unable to add window – 
token android.os.BinderProxy@5d0142d is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:567)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:310)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:86)
at android.app.Dialog.show(Dialog.java:326)
at org.apache.cordova.splashscreen.SplashScreen$5.run(SplashScreen.java:318)
at android.app.Activity.runOnUiThread(Activity.java:5558)
at 
org.apache.cordova.splashscreen.SplashScreen.showSplashScreen(SplashScreen.java:281)
at 
org.apache.cordova.splashscreen.SplashScreen.onMessage(SplashScreen.java:189)
at org.apache.cordova.PluginManager.postMessage(PluginManager.java:312)
at 
org.apache.cordova.CordovaWebViewImpl.postMessage(CordovaWebViewImpl.java:377)
at org.apache.cordova.splashscreen.SplashScreen$3.run(SplashScreen.java:169)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5517)
at java.lang.reflect.Method.invoke(Native Method)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org