In further research of creating a Android Plugin myself with a manifest that already uses other plugins, I once again stumbled upon a problem.
I don’t have anymore errors, but it seems that touch inputs don’t work anymore.
It’s like there is an invisible layer on top of the unity layer, that prevents touches from being registered.
This is how the activity looks like in the manifest for the moment:
I tried several things: With the label, theme, etc…; Without them; With intent-filter, Without it;…
If someone had the same problem and knows the solution, please provide the answer here.
I’m struggling for a long time now, it’s harder than I thought.
I’ll also attach the full manifest in this post.
Thanks in advance.
It seems that the activity is on top of the unity player and freezes it (app not responding anymore). When I start a coroutine with a message every second, it won’t show up. Hope this info helps me and others to find the solution.
Oh, I just checked your manifest file. You have two Unity activities in there? That’s not going to work. You can only have one Unity Activity per process.
Well, you can, as long as the plugins doesn’t require a unique instance of Unity. To be honest I’m not exactly sure what it is you are trying to do here. I mean, what is it you are trying to achieve by having two separate Activities which both are running an instance of the Unity player? Or are you trying to share the instance between two Activity instances?
Well, the first plugin isn’t mine, it’s one that is bought and opens a webview. The iBeacon one is mine and I want to use them both in my app.
The iBeacon app just has to give me all beacons near the device and other usefull info.
So I managed to start my activity by using AndroidJavaObject/Class and also want to call my methods with it. But I stuck there, because it doesn’t respond.
Does this info help you?
How can I start the second Activity and use its methods without problems?
Maybe a silly question but why do you need an Activity to get the beacons? If you start another Activity what normally happens on Android is that the current activity gets paused. Meaning if you start an Activity from inside Unity, Unity will get paused while that Activity is in play. Once that Activity quits Unity will resume execution. It doesn’t necessarily have to be like this but that’s sort of the standard way Android works.
Some useful information on activities:
That being said, in your case I don’t really see a need for an Activity at all (although I know very little of the implementation details). Can’t you just write a regular java class that look up the beacons?
Ow, OK that makes sense. Well, I guess I thought I had to make an activity in order to make it work with Unity. But now you pointed out that this is not necessary, I’ll give it a go as a normal class.
Thank you very much for the info, it is really helpful!
OK, so I have googles cardboard loaded, and need to define an activity that can handle interaction with google speech - I appreciate the issue with activity lifecycle, however this seems to read as the unity activity wins and everyone else looses - how do the Unity folks recommend we deal with these issues - Unity + cardboard + speech is a good thing - Unity + cardboard + OnGui is stupid at best, and on a Durovis Dive 7 helmet is of negative value. I realize I could probably subclass the cardboard activity, but then these extensions become way too specific, i.e. they have to constantly subclass a known activity - right now, at least in terms of what’s in the asset store, you can have cardboard, or you can have speech, but I cannot see how to get both