title: Problems while displaying path between two points in google maps
body: <p>This problem may sound a little weird, but whenever I run the app it crashes and when I change the name of LatLang variable in the function private LatLng getCurrentLocation(), It starts working. But when I change anything(even in any other file) it crashes and I have to keep changing the variable names to keep it running. 
  I am sure of the problem, it is something related to LatLang variable.</p>
  
  <p>GetApproxTimeMaps.java</p>
  
  <pre><code>public class GetApproxTimeMaps extends FragmentActivity {
      private static double destiLatitude;
      private static double destiLongitude;
      GoogleMap mMap;
      GMapV2Direction md;
      LatLng userLocation;
      LatLng destination;
  
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_get_approx_time_maps);
  
          if (android.os.Build.VERSION.SDK_INT &gt; 9) {
              StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
              StrictMode.setThreadPolicy(policy);
          }
          userLocation = getCurrentLocation();
          double lati = userLocation.latitude;
          double longi = userLocation.longitude;
  
          JSONObject jasonObject = getLocationInfo("Infosys");
          boolean value = getLatLong(jasonObject);
          System.out.println("value is: "+ value);
          destination = new LatLng(destiLatitude, destiLongitude);
  
          System.out.println("destination latitude :" + destiLatitude);
          System.out.println("destination longitude :" + destiLongitude);
  
  
          md = new GMapV2Direction();
          mMap = ((SupportMapFragment)getSupportFragmentManager()
                  .findFragmentById(R.id.map)).getMap();
          double toZoomLat = (destination.latitude + userLocation.latitude)/2;
          double toZoomLon = (destination.longitude + userLocation.longitude)/2;
  
          LatLng coordinates = new LatLng(toZoomLat, toZoomLon);
          mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(coordinates, 12));
  
          mMap.addMarker(new MarkerOptions().position(userLocation).title("Start"));
          mMap.addMarker(new MarkerOptions().position(destination).title("End"));
  
          Document doc = md.getDocument(userLocation, destination, GMapV2Direction.MODE_DRIVING);
          int duration = md.getDurationValue(doc);
          String distance = md.getDistanceText(doc);
          String start_address = md.getStartAddress(doc);
          String copy_right = md.getCopyRights(doc);
          System.out.println(duration);
          ArrayList&lt;LatLng&gt; directionPoint = md.getDirection(doc);
          PolylineOptions rectLine = new PolylineOptions().width(3).color(Color.BLUE);
  
          for(int i = 0 ; i &lt; directionPoint.size() ; i++) {
              rectLine.add(directionPoint.get(i));
          }
  
          mMap.addPolyline(rectLine);
      }
      private LatLng getCurrentLocation(){
          LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
          Criteria criteria = new Criteria();
          String provider = service.getBestProvider(criteria, false);
          Location location = service.getLastKnownLocation(provider);
          LatLng userlocat = new LatLng(location.getLatitude(),location.getLongitude());
          return userlocat;
      }
  
      public static JSONObject getLocationInfo(String address) {
          StringBuilder stringBuilder = new StringBuilder();
          try {
  
              address = address.replaceAll(" ","%20");
  
              HttpPost httppost = new HttpPost("http://maps.google.com/maps/api/geocode/json?address=" + address + "&amp;sensor=false");
              HttpClient client = new DefaultHttpClient();
              HttpResponse response;
              stringBuilder = new StringBuilder();
  
  
              response = client.execute(httppost);
              HttpEntity entity = response.getEntity();
              InputStream stream = entity.getContent();
              int b;
              while ((b = stream.read()) != -1) {
                  stringBuilder.append((char) b);
              }
          } catch (ClientProtocolException e) {
          } catch (IOException e) {
          }
  
          JSONObject jsonObject = new JSONObject();
          try {
              jsonObject = new JSONObject(stringBuilder.toString());
          } catch (JSONException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
          return jsonObject;
      }
      public static boolean getLatLong(JSONObject jsonObject) {
  
          try {
  
              destiLongitude = ((JSONArray)jsonObject.get("results")).getJSONObject(0)
                      .getJSONObject("geometry").getJSONObject("location")
                      .getDouble("lng");
  
              destiLatitude = ((JSONArray)jsonObject.get("results")).getJSONObject(0)
                      .getJSONObject("geometry").getJSONObject("location")
                      .getDouble("lat");
  
          } catch (JSONException e) {
              return false;
  
          }
  
          return true;
      }
  </code></pre>