如何在此处组合此代码?
duration = directionsList.get(“duration”); distance = directionsList.get(“distance”);
protected void onPostExecute(String s) {
String[] directionsList;
DataParser parser = new DataParser();
directionsList = parser.parseDirections(s);
displayDirection(directionsList);
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(latLng);
markerOptions.draggable(true);
markerOptions.title("Duration :" + duration);
markerOptions.snippet("Distance :" + distance);
mMap.addMarker(markerOptions);
}
答案 0 :(得分:0)
调试代码并尝试捕获异常。