title: Broadcast receiver not listening on Oreo when app gets killed
body: <p>my broadcast receiver is working fine on Pause() function but when i kill my app my broadcast receiver stops listening only in oreo but working fine on other API Levels less then oreo. i also registered my broadcast receiver in my manifest file and also registered it on my resume().</p>
  
  <p>My Main Activity Code:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      startService(new Intent(this, BroadcastService.class));
      Log.i(TAG, "Started service");
  }
  
  
  @Override
  public void onResume() {
      super.onResume();
      registerReceiver(receiver, new IntentFilter(BroadcastService.COUNTDOWN_BR));
      Log.i(TAG, "Registered broacast receiver");
  }
  </code></pre>
  
  <p>Here is my Service class:</p>
  
  <pre><code>public class BroadcastService  extends Service {
  
      private final static String TAG = "BroadcastService";
  
      public static final String COUNTDOWN_BR = "com.codecollapse";
        Intent bi = new Intent(COUNTDOWN_BR);
  
      CountDownTimer cdt = null;
  
      @Override
      public void onCreate() {
          super.onCreate();
  
          Log.i(TAG, "Starting timer...");
  
          cdt = new CountDownTimer(30000, 1000) {
              @Override
              public void onTick(long millisUntilFinished) {
  
                  Log.i(TAG, "Countdown seconds remaining: " + millisUntilFinished / 1000);
                  bi.putExtra("countdown", millisUntilFinished);
                  //sendBroadcast(bi);
                  sendBroadcast(new Intent(getBaseContext(), CountDownReceiver.class).setAction("com.codecollapse").putExtra("countdown",millisUntilFinished));
              }
  
              @Override
              public void onFinish() {
                  bi.putExtra("IsFinish",true);
                  Log.i(TAG, "Timer finished");
              }
          };
  
          cdt.start();
      }
  
      @Override
      public void onDestroy() {
  
          cdt.cancel();
          Log.i(TAG, "Timer cancelled");
          super.onDestroy();
      }
  
      @Override
      public int onStartCommand(Intent intent, int flags, int startId) {
          super.onStartCommand(intent, flags, startId);
          return START_STICKY;
      }
  
      @Override
      public IBinder onBind(Intent arg0) {
          return null;
      }
  }
  </code></pre>
  
  <p>Here is my receiver class</p>
  
  <pre><code>public class CountDownReceiver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          Toast.makeText(context, "You Poke the service", Toast.LENGTH_SHORT).show();
  
      }
  
  }
  </code></pre>
  
  <p>Here is my manifest file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.androidservices"&gt;
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
      &lt;activity android:name=".MainActivity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;receiver
          android:name=".CountDownReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.codecollapse"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;service android:name=".BroadcastService" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>