Hello i’m trying to add a simple TextView with an Android plugin.
But I discovered that we can’t add a new native view above the UnityPlayer.currentActivity
UnityPlayer.currentActivity.addContentView > Shows the view in the background. So the native view is hidden.
I can’t set the new view on top, above the UnityPlayer.
my project also have this issue, please fix as soon as possible.this is a big bug…why do i must take a huge risk of upgrading in Unity 5.x every time …Unity 5.x in Android is very unsettled …
ps. when i use Unity 5.5, this issue will not happen…so Unity 5.6 is suck…
This guy solved it, and confirmed it works for my other plugin as well.
“For Unity 5.6 or newer, you also need to modify android:name from com.unity3d.player.UnityPlayerActivity tonet.gree.unitywebview.CUnityPlayerActivity. This custom activity implementation will adjust Unity’s SurfaceView z order.”
I was able to do something similar by adjusting the SufaceView child of com.unity3d.player.UnityPlayer, its not pretty, but it does work without having to mess with the manifest.
My code finds the unityPlayer ViewGroup, finds the SurfaceView child, removes it (screen goes black), modifies the ZOrder, and then adds it back. I then add my custom Views as normal.
I’ve got more work & testing, then I’ll post some code.
Update: While the hack worked initially, the test app would quit after a varying amount of time, but not with a crash… at this point, I’m going to roll back to Unity 5.5.3
Yes, this issue is already fixed in 5.6.1p4 (Unity 5.6.1p4)
(916119) - Android: Fixed a regression where Banner Ads are invisible, but still clickable.
You can try with this version to check if this works on your side.