I'm creating GPS tracking app. So I need to run this app at background (or foreground?). How can I call JobIntentService (SecondClass) class when I tap to button "Start" in Fragment (FirstClass)?
I looked for example at this code - but still I don't understand how to call JobIntentService class from Fragment class.
I try to call SecondClass like this (source):
val contentIntent = Intent(context, SecondClass::class.java)
But it ends with this error: java.lang.RuntimeException: Unable to instantiate service com...SecondClass: java.lang.InstantiationException: java.lang.Class<com...SecondClass> cannot be instantiated