This is the xml file:
<http://dating.rs/nemanja/WebService/getPlaces.php?lat=44.8061999&lon=20.4595333&rad=3502&tfs=0>

```
<places>
  <place>
    <id>
      6
    </id>
    <name>
      McDonalds
    </name>
    <type>
      Fast Food
    </type>
    <longitude>
      20.4658031097
    </longitude>
    <latitude>
      44.80228031097
    </latitude>
  </place>
  <place>
    <id>
      5
    </id>
    <name>
      Pizza hut
    </name>
    <type>
      Fast Food
    </type>
    <longitude>
      20.47832518815
    </longitude>
    <latitude>
      44.792844714
    </latitude>
  </place>
</places>

```

This is my code:

```
public class ShopList {

    private ArrayList<String> id = new ArrayList<String>();
    private ArrayList<String> name = new ArrayList<String>();
    private ArrayList<String> type = new ArrayList<String>();
    private ArrayList<String> latitude = new ArrayList<String>();
    private ArrayList<String> longitude = new ArrayList<String>();

with get i set metods...

public class ReturnPlaces extends DefaultHandler {

    Boolean currentElement = false;
    String currentValue = null;
    public static ShopList shopList = null;

    public static ShopList getShopList(){
        return shopList;
    }

    public static void setShopList(ShopList shopList) {
        ReturnPlaces.shopList = shopList;
    }

    @Override
    public void characters(char[] ch, int start, int length)
            throws SAXException {
        if (currentElement) {
            currentValue = new String(ch, start, length);
            currentElement = false;
        }

        //super.characters(ch, start, length);
    }

    @Override
    public void endElement(String uri, String localName, String qName)
            throws SAXException {
        currentElement = false;
        if (localName.equalsIgnoreCase("id"))
            shopList.setId(currentValue);
        else if (localName.equalsIgnoreCase("name"))
            shopList.setName(currentValue);
        else if (localName.equalsIgnoreCase("type"))
            shopList.setType(currentValue);
        else if (localName.equalsIgnoreCase("latitude"))
            shopList.setLatitude(currentValue);
        else if (localName.equalsIgnoreCase("longitude"))
            shopList.setLongitude(currentValue);        
        //super.endElement(uri, localName, qName);
    }

    @Override
    public void startElement(String uri, String localName, String qName,
            Attributes attributes) throws SAXException {        
        currentElement = true;
        if(localName.equalsIgnoreCase("place")){
            shopList = new ShopList();
        }else if (localName.equalsIgnoreCase("id")) {
            String id1 = attributes.getValue("id");
            shopList.setId(id1);
        }else if (localName.equalsIgnoreCase("name")) {
            String name1 = attributes.getValue("name");
            shopList.setName(name1);
        }else if (localName.equalsIgnoreCase("type")) {
            String type1 = attributes.getValue("type");
            shopList.setType(type1);
        }else if (localName.equalsIgnoreCase("latitude")) {
            String latitude1 = attributes.getValue("latitude");
            shopList.setLatitude(latitude1);
        }else if (localName.equalsIgnoreCase("longitude")) {
            String longitude1 = attributes.getValue("longitude");
            shopList.setLatitude(longitude1);
        }
        //super.startElement(uri, localName, qName, attributes);
    }

and this is my activity:

protected void onCreate(Bundle savedInstance) {     
        super.onCreate(savedInstance);
        setContentView(R.layout.pretraga);

        mapView = (MapView) findViewById(R.id.mapView1);
        mapView.setBuiltInZoomControls(true);
        mapController = mapView.getController();        
        mapController.setZoom(17);
        mapView.setStreetView(true);
        listView = (ListView) findViewById(R.id.listView);

        Intent i = getIntent();
        final double niz [] = i.getDoubleArrayExtra("Trenutna lokacija");
        double lat = niz [0];
        double lng = niz [1];
        int radius = i.getIntExtra("Radius", 501);
        boolean vreme = i.getBooleanExtra("Radno vreme", false);        

        try{
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();

            URL sourceUrl = new URL("http://dating.rs/nemanja/WebService/getPlaces.php?lat=44.8061999&lon=20.4595333&rad=3502&tfs=0");
            ReturnPlaces returnPlacesHandler = new ReturnPlaces();
            xr.setContentHandler(returnPlacesHandler);
            xr.parse(new InputSource(sourceUrl.openStream()));
        }catch (Exception e) {
            System.out.println("XML parsing exception"+e);
        }

        shopList = ReturnPlaces.getShopList();

        for(int u = 0; u<shopList.getId().size();u++){
            map = new HashMap<String, String>();
            float distance;                     
            map.put("name", shopList.getName().get(u));
            map.put("type", shopList.getType().get(u));         
            myList.add(map);            
        }

        SimpleAdapter adapter = new SimpleAdapter(this.getApplicationContext(), myList,R.layout.listview1, new String[]{"name","type"},
                new int[]{R.id.textViewName,R.id.textViewType});

        listView.setAdapter(adapter);

```