2

I created the arraylist of hashmaps that pass value from previous intent like this:

final ArrayList<HashMap<String, String>> saleArrList = (ArrayList<HashMap<String, String>>) intent.getSerializableExtra("saleArrList");

Then, I want to get data from this arraylist of hashmaps and i use iterator to point it.

 Iterator<HashMap<String, String>> it = saleArrList.iterator();
                while(it.hasNext()){
                    HashMap<String, String> value = it.next();
                    List<NameValuePair> params = new ArrayList<NameValuePair>();
                     params.add(new BasicNameValuePair("sProductID", saleArrList.get(.....).get("ProductID").toString() ));
            }

I use Hashmap as iterator to point each of Hashmap in Arraylist.

How do I get specifies Hashmaps data form This Arraylist ??

(What code or value that I should put in the get(...) )

Thanks for all answer, Sorry for my wrong grammatically question.

Tell me if you want more code :)

4

1 に答える 1

0

試す

for (HashMap<String, String> arrValue : saleArrList) {
    params.add(new BasicNameValuePair("sProductID", arrValue.get("ProductID") ));   
}

HashMap 値はすでに文字列であるため、 toString() は必要ありません。

于 2012-11-06T10:13:25.600 に答える