如何访问一个变量present在服务 [英] How to access a variable present in a service

查看:146
本文介绍了如何访问一个变量present在服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从另一个服务访问变量present在服务/活动....

I want to access a variable present in a service from another service/an activity....

谁能给个主意?

推荐答案

要两个服务或活动之间的沟通,你需要使用的 AIDL 结果
这是不是真的很难做到,而且有很多教程像<一个href=\"http://mindtherobot.com/blog/37/android-architecture-tutorial-developing-an-app-with-a-background-service-using-ipc/\"相对=nofollow>这个。

To communicate between two service or activity, you need to use AIDL
It is not really difficult to do, and there is a lot of tutorial like this.

这篇关于如何访问一个变量present在服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆