如何在aidl文件中返回hashmap

sun*_*ita 2 android

我想将hashmap作为我从aidl文件中获取方法的返回类型.

但它作为未知的返回类型给出了错误.

我的代码是

interface IRemoteservice { 
    HashMap<String,CharSequence> getMapValues(); 
}
Run Code Online (Sandbox Code Playgroud)

sun*_*ita 6

我从谷歌小组得到了解决方案.现在它工作正常.解决方案是我们必须在aidl文件中声明Map.

interface IRemoteservice { 
   Map getMapValues(); 
}
Run Code Online (Sandbox Code Playgroud)