title: is not an Activity subclass or alias
body: <p>Hello i am trying to follow this: <code>https://technology.jana.com/2014/10/28/periodic-background-tasks-in-android/</code></p>
  
  <p>but for some reason i am getting:
  Error running app: services.BackgroundService is not an Activity subclass or alias</p>
  
  <p>New to android ...</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.mycompany.app"&gt;
  
  &lt;application
      android:name=".Virgo"&gt;
  
      &lt;receiver android:name="receivers.SyncReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.BATTERY_LOW" /&gt;
              &lt;action android:name="android.intent.action.BATTERY_OKAY" /&gt;
              &lt;action android:name="com.mycompany.app.SYNC_TASK_HEART_BEAT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      &lt;receiver android:name="receivers.BootAndUpdateReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MY_PACKAGE_REPLACED" /&gt;
              &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      &lt;service android:name="services.BackgroundService" /&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is my service code as requested:</p>
  
  <pre><code>public class SyncReceiver extends BroadcastReceiver{
      private static final String TAG = "SyncReceiver";
      private static final String INTENT_ACTION = "com.rhotechnology.app.SYNC_TASK_HEART_BEAT";
  
      @Override
  public void onReceive(Context context, Intent intent) {
          if ((intent.getAction() !=null)) {
  
              Virgo virgo = (Virgo) context.getApplicationContext();
              SharedPreferences sharedPreferences = virgo.getSharedPreferences ("syncPreferences", android.content.Context.MODE_PRIVATE);
              if (intent.getAction().equals("android.intent.action.BATTERY_LOW")) {
                  sharedPreferences.edit().putBoolean(Constants.BACKGROUND_SERVICE_BATTERY_CONTROL, false).apply();
                  stopSyncReceiverHeartBeat(context);
              } else if (intent.getAction().equals("android.intent.action.BATTERY_OKAY")) {
                  sharedPreferences.edit().putBoolean(Constants.BACKGROUND_SERVICE_BATTERY_CONTROL, true).apply();
                  restartSyncReceiverHeartBeat(context, virgo);
              } else if (intent.getAction().equals(INTENT_ACTION)) {
                  onSync(context, virgo);
              }
  
          }
  
      }
  
  public void onSync(Context context, Virgo virgo){
      Log.v(TAG,"Syncing");
  }
  
  public void restartSyncReceiverHeartBeat(Context context, Virgo virgo) {
      SharedPreferences sharedPreferences = virgo.getSharedPreferences ("syncPreferences", MODE_PRIVATE);
      boolean isBatteryOk = sharedPreferences.getBoolean(Constants.BACKGROUND_SERVICE_BATTERY_CONTROL, true);
      Intent alarmIntent = new Intent(context, Virgo.class);
      boolean isAlarmUp = PendingIntent.getBroadcast(context, 0, alarmIntent, PendingIntent.FLAG_NO_CREATE) != null;
  
      if (isBatteryOk &amp;&amp; !isAlarmUp) {
          AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
          alarmIntent.setAction(INTENT_ACTION);
          PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, alarmIntent, 0);
          alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), AlarmManager.INTERVAL_FIFTEEN_MINUTES, pendingIntent);
      }
  }
  
  public void stopSyncReceiverHeartBeat(Context context) {
      AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
      Intent alarmIntent = new Intent(context, Virgo.class);
      alarmIntent.setAction(INTENT_ACTION);
      PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, alarmIntent, 0);
      alarmManager.cancel(pendingIntent);
  }
  </code></pre>
  
  <p>}</p>