I’ve attempted to turn the default UnityPlayerActivity into a Service by extending the Service class and making what seems to me to be the required changes to still have the mUnityPlayer do its thing but behind the scenes.
Might seem like an odd request but all the threads related to getting Unity to run in the background have stated to create a service but what they have not been clear on is if all the Unity logic that service would provide would need to be re-written in java or some how kept and executed anyways via original C# Unity code?
In any case as I mentioned at the start, the service executes and mUnityPlayer does everything but setContentView as that isn’t relevant to a service class but my game logic isn’t functioning as I would have hoped.
I’m not sure what Unity is doing behind the scenes such that it isn’t ticking despite being told to from the service class much in the same fashion that the original Activity would.
I’ll keep looking into it in case it should work but I’m missing something the Service needs to actually run correctly.
For clarity my Toast.MakeText does show when onStartCommand is called.