从活动将数据发送到运行服务发送到、数据

2023-09-12 22:21:02 作者:少年三国志

我有一个简短的问题。我怎样才能将数据从一个活动到正在运行的服务?

I have a short question. How can I send data from an activity to an already running service?

该方法是如下,我有一个服务在后台运行,这是开始,这只是显示一个输入窗口,一个新的活动。现在我想的类型的数据发送回服务。如何才能做到这一点?

The approach is as following, I have a service running in the background, which is starting a new activity that is just showing an input window. And now I want to send the typed data back to the service. How can this be done?

在此先感谢您的帮助! 诚挚的问候 托比

Thanks in advance for helping! Best regards Tobi

推荐答案

您知道 onBind 方法服务类?

 
精彩推荐
图片推荐