Skip to content Skip to sidebar Skip to footer

Adding Markers From Google Maps In Asynctask

I want to add a marker to Google Maps after I've done something in AsyncTask. However, when I attempt to add a marker onPostExecute after the operation, An error will occur: java.

Solution 1:

mMap object didn't set anything. So it will return null. You can set like that:

@Override
public void onMapReady(final GoogleMap googleMap) {
    mMap = googleMap;
    GetXMLTask task = new GetXMLTask(getApplicationContext());
    task.execute("http://openapi.its.go.kr:8081/api/NCCTVInfo?key=1526041502162&ReqType=2&MinX=" + 126 + "&MaxX=" + 127 + "&MinY=" + 35 + "&MaxY=" + 38 + "&type=ex");
}

Post a Comment for "Adding Markers From Google Maps In Asynctask"