Multiple Sensor data Xamarin Android
<p>Hi i have a big problem too get data from multiple Sensors
my code for register and read data is:</p>

<pre><code>    [Service]
    class BackgroundServiceSensoren : Service
    {
     StepDetector sd;
     Azimut az;
    double obererSchwellenWert = 2.0;
      double untererSchwellenWert = -2.0;
     Boolean timerFlag = false;

    public override IBinder OnBind(Intent intent)
    {
        return null;
    }
      public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
    {
        Task.Run(() =&gt;
        {
        sd = new StepDetector(obererSchwellenWert, untererSchwellenWert, timerFlag, 0);
            az = new Azimut();

            var mSensorManager1 = (SensorManager)Application.Context.GetSystemService(Context.SensorService);
            var mSensorManager2 = (SensorManager)Application.Context.GetSystemService(Context.SensorService);
            var mLinearAccelerometer = mSensorManager1.GetDefaultSensor(SensorType.LinearAcceleration);
           // mSensorManager1.RegisterListener(sd, mLinearAccelerometer, SensorDelay.Fastest);
            var mAzimutMagneticField = mSensorManager2.GetDefaultSensor(SensorType.MagneticField);
            var mAzimutAccelerometer = mSensorManager2.GetDefaultSensor(SensorType.Accelerometer);

          mSensorManager2.RegisterListener(az, mAzimutMagneticField, SensorDelay.Game);
              mSensorManager2.RegisterListener(az, mAzimutAccelerometer, SensorDelay.Fastest);


        });
        return StartCommandResult.Sticky;
    }

class Azimut : Java.Lang.Object, ISensorEventListener
{
    float [] mGravity;
    float [] mGeomagnetic;
    float azimut;



    public void OnAccuracyChanged(Sensor sensor, [GeneratedEnum] SensorStatus accuracy)
    {

    }

 public void OnSensorChanged(SensorEvent e)
    {
        Sensor mySensor = e.Sensor;

        if (mySensor.Type == SensorType.Accelerometer)
        {
            if (mGravity == null)
            {
                mGravity = new float[3];
            }
            e.Values.CopyTo(mGravity, 0);


        }
        if (mySensor.Type == SensorType.MagneticField)
        {
            if(mGeomagnetic == null){
                mGeomagnetic = new float[3];
            }
            e.Values.CopyTo(mGeomagnetic,0);


        }

        if (mGeomagnetic != null &amp;&amp; mGravity != null)
        {
            float[] R = new float[9];
            float[] I = new float[9];
            bool success = SensorManager.GetRotationMatrix(R, I, mGravity, mGeomagnetic);
            if (success)
            {
                float[] orientation = new float[3];
                SensorManager.GetOrientation(R, orientation);
                azimut = orientation[0];
                Xamarin.Forms.Device.BeginInvokeOnMainThread(() =&gt;
                {
                    Toast.MakeText(Application.Context, azimut.ToString(), ToastLength.Short).Show();
                });

            }
        }
    }
</code></pre>

<p>But I get only the Values from Accelerometer, but how can I get the Values from Accelerometer and MagneticField</p>