Android Service
- 如果被bind的service在另外一个进程中
- ServiceConnection的onServiceConnected(ComponentName name, IBinder service)回调的IBinder service参数一定是一个android.os.BinderProxy对象
- 对于android.os.BinderProxy必须使用XxxService.Stub.asInterface(android.os.IBinder obj)才能得到XxxService的代理对象
- local service中返回的binder(没有使用aidl生成)因为没有.Stub.asInterface()调用,所以localService不能在另外的进程中启动
- service的android:process属性只有以":"(冒号)开头,新启动的进程才会以主进程名(一般为应用包名)为前缀
- 如果被bind的service在另外一个进程中
- ServiceConnection的onServiceConnected(ComponentName name, IBinder service)回调的IBinder service参数一定是一个android.os.BinderProxy对象
- 对于android.os.BinderProxy必须使用XxxService.Stub.asInterface(android.os.IBinder obj)才能得到XxxService的代理对象
- local service中返回的binder(没有使用aidl生成)因为没有.Stub.asInterface()调用,所以localService不能在另外的进程中启动
- service的android:process属性只有以":"(冒号)开头,新启动的进程才会以主进程名(一般为应用包名)为前缀