title: How to launch google maps app in the background from my app
body: <p>First note, I am using Xamarin for Android, so there are minor syntax differences to Android Java. I am launching the google maps app from an activity in my own Android app. I have figured out how to launch it in turn by turn navigation mode giving voice guided directions, skipping the regular activity that it normally defaults to. However, the default map activity does come up very briefly before then going right into turn by turn activity. I can live with that. </p>
  
  <p><strong>The challenge is that the user has to click the back button multiple times to get back to my app</strong>, rather than once where it goes from turn by turn activity, straight back to my app, which is what I would prefer. I know why it's doing that and it's natural. <strong>Is there any way for my app to launch the map in voice guided mode, but launch it in the background keeping my app in the foreground?</strong> </p>
  
  <p>I have seen that if I use my back button to return to my app, the turn by turn voice directions stop. If I use the window icon at phone bottom to see all my recent apps and bring mine to the foreground after launching the maps app, the voice directions keep working, which is what I want, and it even gives me notification overlays over top of my app which is great. I don't want to have to tell the user to use that windows icon when he wants to bring my app into the foreground, and I don't want him using the back button because it will stop the voice directions. So it's a tough spot and i wouldn't be surprised if this is just one of those phone behavior things you have to live with, but I'm hoping anybody can offer any suggestions. <strong>Maybe even making it part of a fragment app? But would I just get their maps with that or would I get the full voice directions feature as well?</strong> I thought I could only get that from their installed app, not their library. Thanks for reading.</p>
  
  <p>Here's my current code</p>
  
  <pre><code>public void StartNavigation(string lat, string lng)
  {
      String strUri = "google.navigation:q=" + lat + "," + lng;
      Intent Intent = new Intent(Android.Content.Intent.ActionView, Android.Net.Uri.Parse(strUri));
      //Intent.SetClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
      Intent.SetPackage("com.google.android.apps.maps");
      Application.Context.StartActivity(Intent);
  }
  </code></pre>