title: Opening bluetooth settings page and returning to application
body: <p>I have created a Xamarin cross-platform application. In which i have to open Bluetooth setting page of my xamarin cross-platform Android application via clicking on a button created. </p>
  
  <p>As soon as the settings open i need to pair device similar to paring in the normal device.</p>
  
  <p>If i click the back button it should return back to my created application.</p>
  
  <p>I have created the following code in my xamarin.form page:</p>
  
  <p>Bluetooth.xaml.cs:</p>
  
  <pre><code>using Android.Content;
  using System.Runtime.InteropServices;
  using Android.Support.Design.Widget;// Does not accept this in xamarin forms
  using Android.Support.V7.App;// Does not accept this in xamarin forms
  
  
  private void OnSettingsDevice_Button(object sender, EventArgs e)
      {
          Intent intentOpenBluetoothSettings = new Intent();    
         intentOpenBluetoothSettings.SetAction(Android.Provider.Settings.ActionBluetoothSettings);
         StartActivity(intentOpenBluetoothSettings);
      }
  </code></pre>
  
  <p>It throws an error stating </p>
  
  <blockquote>
    <p>The name 'StartActivity' does not exist in the current context.</p>
  </blockquote>
  
  <p>I even wrote this code in mainactivity.cs which stored in my App.Droid application. I am unable to call this in my xamarin form page.</p>
  
  <p>Even tried with creating a function for this code and call that function in my Xamarin.forms.cs file as well.</p>
  
  <p>Tried with <a href="https://jeremylindsayni.wordpress.com/2018/12/16/how-to-detect-nearby-bluetooth-devices-with-net-and-xamarin-android/" rel="nofollow noreferrer">https://jeremylindsayni.wordpress.com/2018/12/16/how-to-detect-nearby-bluetooth-devices-with-net-and-xamarin-android/</a> Blog but could not execute it.</p>
  
  <p>Please help me out with this issue.</p>
  
  <p>thanks in advance</p>