`

Android AIDL Object实现步骤

阅读更多
  1. 打包的对象类Rect实现android.os.Parcelable接口.
  2. 创建Rect.aidl填入如下代码:
  3. package cn.lx;
    parcelable Rect; 
  4. 声明Service接口,RectService.aidl;必须import对应的打包类
  5. package cn.lx.aidl;
    import cn.lx.Rect;
    interface RectService{
         cn.lx.Rect intersection(in cn.lx.Rect left,in cn.lx.Rect right);
    } 
  6. 实现RectService.Stub类中的方法.
  7. 在Service.onBind(Intent)返回RectService.Stub实现类的实例。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics