試圖遠程一些接口從Android應用程序服務到另一個客戶端應用程序,並使用AIDL方法..
所以我有一個接口IJobController在IJobController.aidl :
import com.example.jobs.api.IJobExecutionContext;如何返回活動對象的列表中的Android IPC
interface IJobController {
List<IJobExecutionContext> getCurrentlyExecutingJobs();
...
}
其中IJobExecutionContext在其自身的AIDL定義:
interface IJobExecutionContext {
Bundle getJobResult();
...
long getJobStartTime();
long getJobEndTime();
long getJobRunTime();
}
當這些定義在根文件夾進行編譯,我得到這樣的在生成IJobController.java文件錯誤:
Type mismatch: cannot convert from ArrayList<IBinder> to List<IJobExecutionContext>
The method writeBinderList(List<IBinder>) in the type Parcel is not applicable for the arguments (List<IJobExecutionContext>)
從我所瞭解的情況來看,這些接口可以與基本類型,Parcelable等一起用於List(或Map)中。 在另一個只返回AIDL接口的方法中,一切正常,但似乎在列表容器中不是。
我是否需要返回原始列表或IJobExecutionContext的實現列表,它也是可分組?
謝謝。