title: Android onCreate of Activity class is not triggered
body: <p>I am trying to write a plugin for Capacitor. It should pass the accelerometer data to the JavaScript. The bridge works fine.
  However, the heading class does not seem to be initialized. The onCreate function does not seem to be executed, so do all the other functions. Nothing is logged to the console.
  In AndroidManifest.xml I have requested the following feature:</p>
  <pre><code> &lt;uses-feature android:name=&quot;android.hardware.sensor.accelerometer&quot; android:required=&quot;true&quot; /&gt;
  </code></pre>
  <p>The file looks like this:</p>
  <pre><code>package de.example.capmap;
  
  import android.app.Activity;
  import android.content.Context;
  import android.hardware.Sensor;
  import android.hardware.SensorEvent;
  import android.hardware.SensorEventListener;
  import android.hardware.SensorManager;
  import android.os.Bundle;
  import android.util.Log;
  
  import com.getcapacitor.BridgeActivity;
  
  import de.example.Compass;
  
  public class MainActivity extends BridgeActivity {
      private Heading heading;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          registerPlugin(Compass.class);
          heading = new Heading();
      }
  
  }
  
  class Heading extends Activity implements SensorEventListener {
      private SensorManager sensorManager;
      private Sensor mAccelerometer;
  
      private static final String TAG = &quot;Heading&quot;;
  
      @Override
      public final void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Log.i(TAG, &quot;onCreate: Initializing&quot;);
  
          sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
          mAccelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
          sensorManager.registerListener(Heading.this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
      }
  
      @Override
      public void onSensorChanged(SensorEvent event){
          Log.i(TAG, &quot;onSensorChanged: &quot; +  event.values[0]);
      }
  
      @Override
      public void onAccuracyChanged(Sensor sensor, int accuracy) {
          Log.i(TAG, &quot;onAccuracyChanged:&quot; +  accuracy);
      }
  
  
      @Override
      protected void onResume() {
          super.onResume();
          sensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          sensorManager.unregisterListener(this);
      }
  }
  </code></pre>
  <p>and the Compass Plugin, which gets executed:</p>
  <pre><code>
  import com.getcapacitor.JSObject;
  import com.getcapacitor.Plugin;
  import com.getcapacitor.PluginCall;
  import com.getcapacitor.PluginHandle;
  import com.getcapacitor.PluginMethod;
  import com.getcapacitor.annotation.CapacitorPlugin;
  import com.getcapacitor.Bridge;
  
  
  @CapacitorPlugin(name = &quot;Compass&quot;)
  public class Compass extends Plugin  {
  
      public static Bridge staticBridge = null;
  
      @Override
      public void load() {
          staticBridge = this.bridge;
          java.lang.System.out.println(&quot;Compass successfully started&quot;);
      }
  
      public static void onMagneticHeading(float magneticHeading){
          Compass pushPlugin = Compass.getCompassInstance();
          if (pushPlugin != null) {
              pushPlugin.sendMagneticHeading(magneticHeading);
          }
      }
  
      @PluginMethod()
      public void getMagneticHeading(PluginCall call) {
          String value = call.getString(&quot;value&quot;);
          JSObject ret = new JSObject();
          ret.put(&quot;magneticHeading&quot;, value);
          call.resolve(ret);
      }
  
      public void sendMagneticHeading(float magneticHeading) {
          JSObject data = new JSObject();
          data.put(&quot;magneticHeading&quot;, magneticHeading);
          notifyListeners(&quot;heading&quot;, data, true);
      }
  
  
      public static Compass getCompassInstance() {
          if (staticBridge != null &amp;&amp; staticBridge.getWebView() != null) {
              PluginHandle handle = staticBridge.getPlugin(&quot;Compass&quot;);
              if (handle == null) {
                  return null;
              }
              return (Compass) handle.getInstance();
          }
          return null;
      }
  }
  
  
  
  </code></pre>