我在soap消息中工作过,为了解析来自Webservice的值,这些值存储在ArrayList中。
示例: 值是员工姓名(Siva)和员工id(3433fd),这两个值存储在arraylist中,但我想存储在Dictionary中,如何?
最佳答案
你可以像这样使用HashMap
Map <String,String> map = new HashMap<String,String>();
//add items
map.put("3433fd","Siva");
//get items
String employeeName =(String) map.get("3433fd");
关于android - 如何在 android 中使用 Dictionary(如 iphone NSDictionary)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8861183/