0

I have defined a List in my main class where I am loading data from KSoap response:

List<HashMap<String, String>> POIs= new ArrayList<HashMap<String, String>>();

I add entry to the Listusing the following code:

for (int i = 0; i < response1.getPropertyCount(); i++) {            
  SoapObject response2 = (SoapObject) response1.getProperty(i);
  HashMap<String, String> map = new HashMap<String, String>();                  
  map.put("ID",response2.getProperty("CID").toString());
  map.put("Distance",response2.getProperty("distance").toString());
  map.put("SubLocality",response2.getProperty("SubLocality1").toString());
  POIs.add(map);
}

I like to know how I put the list POIs to an intent?

2 Answers 2

1

Access your List using the main class' object. Simple as that.

Sign up to request clarification or add additional context in comments.

3 Comments

Create a getter method in your main class. In your activity,make object of that class and access the List.
If you even need a code for this, you need to go back to Java basics.
@tai.tran2008 not unless it is actually a requirement.
1

I used Bundle.putSerializable to pass the List since the it is not large (only about 10 items).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.