public void postRequestHandler(String result) { aButton.setEnabled(true); JSONObject json_obj; try { json_obj = new JSONObject(result); String slat = json_obj.getString("latitude"); String slong = json_obj.getString("longitude"); String countryname = json_obj.getString("country_name"); String city = json_obj.getString("city"); String region = json_obj.getString("region"); double lat = Double.parseDouble(slat); double lon = Double.parseDouble(slong); GeoPoint gp = getPoint(lat, lon); mapView.getController().setZoom(9); mapView.getController().animateTo(gp); List<Overlay> mapOverlays = mapView.getOverlays(); Drawable drawable = this.getResources().getDrawable(R.drawable.marker); SitesOverlay itemizedoverlay = new SitesOverlay(drawable, getApplicationContext()); OverlayItem overlayitem = new OverlayItem(gp, ipaddress, ipaddress); itemizedoverlay.addOverlay(overlayitem); mapOverlays.add(itemizedoverlay); TextView textView = (TextView) findViewById(R.id.display); textView.setText( "Longitude = " + slat + " \nLongitude = " + slong + " \nCity = " + city + " \nRegion = " + region + " \nCountry = " + countryname); textView.setHorizontalScrollBarEnabled(true); Toast toast = Toast.makeText(getApplicationContext(), "Request has completed succesfully", 3); toast.show(); } catch (JSONException e) { Toast toast = Toast.makeText( getApplicationContext(), "Unable to process request...please try again", 10); toast.show(); } }