title: How to implement Headless JS in react native android application?
body: <p><strong>I need implement Headless JS in my React Native Android Application, but I got following issue :</strong>  </p>
  
  <p><a href="https://i.stack.imgur.com/ixFLK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ixFLK.png" alt="enter image description here"></a></p>
  
  <p>Here is My Code :</p>
  
  <p><strong>index.android.js :</strong></p>
  
  <pre><code>import React, { Component } from 'react';
  import {AppRegistry} from 'react-native';
  import SomeTaskName from './SomeTaskName'
  AppRegistry.registerComponent('SomeTaskName', () =&gt; SomeTaskName);
  </code></pre>
  
  <p><strong>SomeTaskName.js</strong></p>
  
  <pre><code>module.exports = async (taskData) =&gt; {
     alert('test');
  }
  </code></pre>
  
  <p><strong>MyTaskService.java</strong></p>
  
  <pre><code>import android.content.Intent;
  import android.os.Bundle;
  import com.facebook.react.HeadlessJsTaskService;
  import com.facebook.react.bridge.Arguments;
  import com.facebook.react.jstasks.HeadlessJsTaskConfig;
  public class MyTaskService extends HeadlessJsTaskService {
     @Override
     protected HeadlessJsTaskConfig getTaskConfig(Intent intent) {
     Bundle extras = intent.getExtras();
       if (extras != null) {
          return new HeadlessJsTaskConfig(
            "MyTaskService",
            Arguments.fromBundle(extras),
           5000);
       }
       return null;
    }
  }
  </code></pre>
  
  <p>and add service in <strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;service android:name=".MyTaskService" android:enabled="true" android:label="MyTaskService" /&gt;
  </code></pre>
  
  <p>Please , Anyone help to fix this issue.</p>