title: How to open parent activity with last visited content page from another activity in xamarin.forms?
body: <p>I am working in <code>xamarin.forms</code>. I am stuck in activity navigation in Android. </p>
  
  <p>My whole application is working under one <code>Activity</code> that is <code>MainActivity</code>.
  From one of my content page, I want to open Contact application with all list of contacts.</p>
  
  <p>I have created one another activity and start that activity on button clicks from the Content page using Dependency service like below code.</p>
  
  <pre><code>var intent = new Intent(Forms.Context, typeof(ContactApplicationActivity));
  Forms.Context.StartActivity(intent);
  </code></pre>
  
  <p>Now <code>OnCreate</code> method of <code>ContactApplicationActivity</code> I move to Contact application. And When the user clicks on any contact <code>OnActivityResult</code> method call and open message and Email default application.</p>
  
  <p>ContactApplicationActivity.cs:</p>
  
  <pre><code>public class ContactApplicationActivity : Activity
      {
          public object smsTask { get; private set; }
  
          protected override void OnCreate(Bundle savedInstanceState)
          {
              base.OnCreate(savedInstanceState);
  
              var contactPickerIntent = new Intent(Intent.ActionPick,
                  Android.Provider.ContactsContract.Contacts.ContentUri);
              StartActivityForResult(contactPickerIntent, 101);
          }
  
          protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
          {
              if (InviteFriends.IsSMS &amp;&amp; !InviteFriends.IsEmail)
              {
                  if (requestCode == 101 &amp;&amp; resultCode == Result.Ok)
                  {
                      //Ensure we have data returned
                      if (data == null || data.Data == null)
                          return;
                      var addressBook = new Xamarin.Contacts.AddressBook(this);
                      addressBook.PreferContactAggregation = false;
  
                      //Load the contact via the android contact id in the last segment of the Uri returned by the  android contact picker
                      var contact = addressBook.Load(data.Data.LastPathSegment);
  
                      //Use linq to find a mobile number
                      var mobile = (from p in contact.Phones
                                    where p.Type == Xamarin.Contacts.PhoneType.Mobile
                                    select p.Number).FirstOrDefault();
  
                      //See if the contact has a mobile number
                      if (string.IsNullOrEmpty(mobile))
                      {
                          Toast.MakeText(this, "No Mobile Number for contact!",
                              ToastLength.Short).Show();
                          return;
                      }
                      else
                      {
                          if (CrossMessaging.Current.SmsMessenger.CanSendSms)
                          {
                              CrossMessaging.Current.SmsMessenger.SendSms(mobile, "My Message");
                          }
                      }
                  }
              }
              else if (!InviteFriends.IsSMS &amp;&amp; InviteFriends.IsEmail)
              {
                  //Ensure we have data returned
                  if (data == null || data.Data == null)
                      return;
                  var addressBook = new Xamarin.Contacts.AddressBook(this);
                  addressBook.PreferContactAggregation = false;
  
                  //Load the contact via the android contact id in the last segment of the Uri returned by the android contact picker
                  var contact = addressBook.Load(data.Data.LastPathSegment);
  
                  //Use linq to find a mobile number
                  var emailid = (from p in contact.Emails
                                 where p.Type == Xamarin.Contacts.EmailType.Home
                                 select p.Address).FirstOrDefault();
  
                  //See if the contact has a mobile number
                  if (string.IsNullOrEmpty(emailid))
                  {
                      Toast.MakeText(this, "No Email for contact!",
                          ToastLength.Short).Show();
                      return;
                  }
                  else
                  {
                      var email = BuildSampleEmail(emailid, true).Build();
                      if (CrossMessaging.Current.EmailMessenger.CanSendEmail)
                      {
                          CrossMessaging.Current.EmailMessenger.SendEmail(email);
                      }
                  }
              }
  
          }
          public static EmailMessageBuilder BuildSampleEmail(string ToEmailId, bool sendAsHtml = false)
          {
              //var builder = new EmailMessageBuilder()
              //    .To(ToEmailId)
              //    .Cc("cc.plugins@xamarin.com")
              //    .Bcc(new[] { "bcc1.plugins@xamarin.com", "bcc2.plugins@xamarin.com" })
              //    .Subject("eRecall App");
  
              var builder = new EmailMessageBuilder()
                  .To(ToEmailId)
                  .Subject("ABC");
  
              if (sendAsHtml)
                  builder.BodyAsHtml("&lt;b&gt;My Message &lt;/b&gt;");
  
              return builder;
          }
      }
  </code></pre>
  
  <p>Everything is working fine. But the problem is when Contact application is open from <code>ContactApplicationActivity</code> Activity. <code>MainActivity</code> is in the background. When I try to open My original application from Background mode. It opens with a blank screen with Title <code>ContactApplicationActivity</code>. And When I press back button <code>MainActivity</code> with my last content page is open.</p>
  
  <p>I want to open Last content page of my <code>MainActivity</code> without any blank screen</p>
  
  <p>Is it possible to solve it using <code>activity flag</code>?</p>