title: Kotlin Intent with Service Class that requires a constructor
body: <p>I am starting a service from a <code>Fragment</code> class. My <code>Service</code> class has one argument in its constructor. </p>
  
  <p>From my <code>Fragment</code> I have a function that triggers this: </p>
  
  <pre><code>val serviceIntent = Intent(context, ServiceClass::class.java)
  activity!!.startService(serviceIntent)
  </code></pre>
  
  <p>And this is my Service class, which uses a Singleton that requires a <code>Context</code>: </p>
  
  <pre><code>class ServiceClass(var context: Context): Service(){
  
  companion object : SingletonHolder&lt;ServiceClass, Context&gt;(::ServiceClass)
  
  override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
  
       return START_STICKY
  }
  </code></pre>
  
  <p>Every time I call my <code>Intent</code> I get an error:</p>
  
  <blockquote>
    <p>Unable to instantiate service ServiceClass: java.lang.InstantiationException: java.lang.Class has no zero argument constructor
            at ...</p>
  </blockquote>
  
  <p>How would I come about passing a <code>Context</code> argument via an <code>Intent</code></p>
  
  <p>Any link to documentation on the matter would be appreciated.</p>