在aidl(ipc)中传递自定义arraylist



我正试图在进程间通信中传递一个自定义数组列表。我制作了两个类似的辅助文件

IMyAidl接口.aidl

package com.amaze.DrivePlugin;
import com.amaze.DrivePlugin.Layoutelements;
// Declare any non-default types here with import statements
interface IMyAidlInterface {
    /**
     * Demonstrates some basic types that you can use as parameters
     * and return values in AIDL.
     */
    ArrayList<Layoutelements> list(in String driveID);
}

这里的Layoutelements是一个实现可分组的自定义类

布局元素.aidl

package com.amaze.DrivePlugin;
// Declare any non-default types here with import statements
parcelable Layoutelements;

错误显示"未知返回类型arraylist"。

我也尝试导入arraylist,但这对没有帮助

使用java.util.List而不是ArrayList通常可以解决

问题

最新更新