title: start navigating to position which is stored in database
body: <p>I have an application where I am getting the latitude and longitude coordinates.</p>
  
  <p>I want , when to press a button to start navigating to that position .</p>
  
  <p>Now , I am storing latitude and longitude in database.</p>
  
  <p>So , I want to extract the location first.When I press the button to navigate I open an alertdialog and in 'YES' I do:</p>
  
  <pre><code>public void navigation(final View v){
  
  
  
       AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);
          alt_bld.setMessage("Do you want to navigate to the saved position?")
                  .setCancelable(false)
                  .setPositiveButton("Navigate",
                          new DialogInterface.OnClickListener() {
                              public void onClick(DialogInterface dialog,
                                      int id) {
  
                          // Action for 'Yes' Button
  
                          String query = "SELECT latitude,longitude FROM MEMORIES ";
                          Cursor c1 = sqlHandler.selectQuery(query);
  
                          if (c1 != null &amp;&amp; c1.getCount() != 0) {
                              if (c1.moveToFirst()) {
                                  do {                
          String mylatitude=c1.getString(c1.getColumnIndex("latitude"));
          String mylongitude=c1.getString(c1.getColumnIndex("longitude"));
  
          Double lat=Double.parseDouble(mylatitude);
          Double lon=Double.parseDouble(mylongitude); 
  
  
                                      } while (c1.moveToNext());
                                  }
                              }
  
                              c1.close();
  
  
              Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
                      Uri.parse("http://maps.google.com/maps?saddr=" + 
                      gps.getLocation().getLatitude() + "," + 
                      gps.getLocation().getLongitude() + "&amp;daddr=" + mylatitude + "," + mylongitude ));
                      startActivity(intent);
  
  
                              }
                          })
                  .setNegativeButton("Cancel",
                          new DialogInterface.OnClickListener() {
                              public void onClick(DialogInterface dialog,
                                      int id) {
                                  // Action for 'NO' Button
                                  dialog.cancel();
                              }
                          });
          AlertDialog alert = alt_bld.create();
          // Title for AlertDialog
          alert.setTitle("Navigation");
          alert.show();
  
   }
  </code></pre>
  
  <p>I have the location stored (lat and lon) and i want to start navigating to that position.
  How can I do that?</p>
  
  <p>Thanks!</p>
  
  <p>---------------------UPDATE-------------------------------------</p>
  
  <p>If I do sth like:</p>
  
  <pre><code>    String mylat="";
  String mylon="";
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  ...
  ...
  public void navigation(final View v){
  ....
  String mylatitude=c1.getString(c1.getColumnIndex("latitude"));
  String mylongitude=c1.getString(c1.getColumnIndex("longitude"));
  
  
  mylat=mylatitude;//stored coordinates from database 
  mylon=mylongitude;
  
  String f="45.08" //current location (start points)
  String s="23.3";
  
  Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
  Uri.parse("http://maps.google.com/maps?saddr=" + 
  f + "," + 
  s + "&amp;daddr=" + mylat + "," + mylon ));
  startActivity(intent);
  </code></pre>
  
  <p>The intent starts and I am in the map application where the start points are the "f" and "s" I defined above but the destination points are 0.0 , 0.0 ;</p>
  
  <p>So , I have 2 problems:</p>
  
  <p>1) How to put to destination points  my stored locations (mylatitude ,mylongitude (which I copy to mylat,mylon)</p>
  
  <p>2) How to get current location (initial points) because my gps class doesn't work on that.</p>