首页 > 解决方案 > 从 Android 中的前台服务调用 Unity 函数

问题描述

我想知道现在这是否可能。我希望能够在我的android应用程序中使用unitysendmessage,而它处于后台状态或者更好的是仍然在后台运行更新功能(仅在此服务处于活动状态时)

我确实有一个单独的前台服务在某个实例中运行,假设 30 秒后我需要杀死应用程序或将其带到前台,我对 android 开发非常陌生,并且仍然对意图的想法和活动,

运行此代码段:

Intent notificationIntent = new Intent(this, myActivity.getClass());
startActivity(notificationIntent);

似乎只是在打开应用程序(在这种情况下是基于统一的应用程序)时再次启动后台服务。

这里的任何帮助将不胜感激

标签: androidunity3dservice

解决方案


推荐阅读