2011-04-01 141 views
1

我想把hashmap作爲aidl文件中方法的返回類型。如何在aidl文件中返回hashmap

但它給錯誤作爲未知的返回類型。

我的代碼是

interface IRemoteservice { 
    HashMap<String,CharSequence> getMapValues(); 
} 

回答

5

我從谷歌集團的解決方案。 現在它工作正常。 解決方案是我們必須在aidl文件中聲明Map。

interface IRemoteservice { 
    Map getMapValues(); 
} 
+0

http://groups.google.com/group/android-developers/browse_thread/thread/3e6772b0041b6055# – sunita 2011-04-01 03:02:49

+0

+1和下面的線程可能是相關的,以及:http://stackoverflow.com/q/3988609/2946787 + http://stackoverflow.com/a/6360359 – sfinja 2013-12-29 20:02:44