title: i can't get the bluetooth devices in android
body: <p>i'm using xamarin android i want to get all the nearby bluetooth devices i tried this but it gives me an error saying: Object reference not set to an instance of an object.</p>
  
  <pre><code>          IntentFilter filter = new IntentFilter(BluetoothDevice.ActionFound);
            BluetoothDeviceReceiver mReceiver = new BluetoothDeviceReceiver();
            RegisterReceiver(mReceiver, filter);
            mBluetoothAdapter.StartDiscovery();
  
      class BluetoothDeviceReceiver : BroadcastReceiver
      {
      public override void OnReceive(Context context, Intent intent)
      {
          String action = intent.Action;
          MainActivity ma = new MainActivity();            
          if (action == BluetoothDevice.ActionFound)
          {
              // Get device
              BluetoothDevice newDevice = (BluetoothDevice)intent.GetParcelableExtra(BluetoothDevice.ExtraDevice);
              // now you could do your job with newDevice
              ma.mArrayAdapter.Add(newDevice.Name + " -&gt; " + newDevice.Address);
              ma.lsv1.Adapter = ma.mArrayAdapter;
  
          }
  
          else
          {
  
          }
      }
  }
  </code></pre>
  
  <p>the error at:</p>
  
  <pre><code>MainActivity ma = new MainActivity();            
  ma.mArrayAdapter.Add(newDevice.Name + " -&gt; " + newDevice.Address);
  ma.lsv1.Adapter = ma.mArrayAdapter;
  </code></pre>