title: Android Broadcast Receiver not starting (Kotlin)
body: <p>I've installed a broadcast receiver a few weeks ago in Java, now I want to do it in Kotlin, but unfortunately it does not work.</p>
  
  <p>My Manifest:</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.test.test"
      android:installLocation="internalOnly"&gt;
  
      &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/&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="com.test.test.BootReceiver"
              android:enabled="true"
              android:exported="true"
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
                  &lt;action android:name="android.intent.action.QUICKBOOT_POWERON" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>My receiver:</p>
  
  <pre><code>package com.test.test
  
  import android.content.BroadcastReceiver
  import android.content.Context
  import android.content.Intent
  import android.content.Intent.ACTION_BOOT_COMPLETED
  import android.util.Log
  
  class BootReceiver : BroadcastReceiver() {
  
      override fun onReceive(c: Context, intent: Intent?) {
          val action = intent?.action
          Log.d("ASD123123", "RECEIVED BOOT")
          val b = intent?.toUri(Intent.URI_INTENT_SCHEME)
          when (action) {
              ACTION_BOOT_COMPLETED -&gt; startWork(c)
          }
      }
  
  
      private fun startWork(context: Context) {
          Log.d("Test", "Test")
      }
  }
  </code></pre>
  
  <p>When I reboot my device (Android 8.0.0) it does not start the service. Neither does it when I run </p>
  
  <pre><code>adb shell
  am broadcast -a android.intent.action.BOOT_COMPLETED
  </code></pre>
  
  <p>With</p>
  
  <pre><code>am broadcast -a android.intent.action.BOOT_COMPLETED -n com.test.test/.Bootreceiver
  </code></pre>
  
  <p>it works though. What is wrong with my code?</p>