一般来说:同一个包内的activity和service,如果service没有设定属性android:process=":remote"的话,service会和activity跑在同一个进程中,由于一个进程只有一个UI线程,所以,service和acitivity就是在同一个线程里面的。




android:process=":remote"值得注意他的用法!!!如果Activity想访问service中的对象或方法,如果service设定属性android:process=":remote",那么就是跨进程访问,跨进程访问容易出现意想不到的问题,还是慎重给service设定属性android:process=":remote"

更多相关文章

  1. Android中进程间通讯 AIDL
  2. AIDL进程间通信详解

随机推荐

  1. Android用户手势检测
  2. Android中IntentService和HandlerThread
  3. xml 做图
  4. Android一些基础面试题
  5. android ViewFlipper使用示例(注册引导页)
  6. Android 平台开源3D游戏引擎列表
  7. android 多线程编程
  8. EventBus源码追踪
  9. 如何更好地使用EventBus
  10. 外部导入Android工程出错