I am struggling with this error:
08-08 11:42:53.179: E/AndroidRuntime(20288): Caused by: java.lang.InstantiationException: can\'t instantiate class co
If you have your Service declared as an Inner Class / Nested Class, you also need to make the class static
Without that you´ll get the error even if your constructor is correct
Explanation
The reason for that is, you can only instantiate inner classes in the context of the outer class, so you would need to create an instance of the outer class first.
Declaring your inner class static makes it independent from its outer class
You need to add the default no-argument constructor to your ReminderService class. This is only implicitly added if you don't write a constructor of your own (which you have). See here: http://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html
You need to add an empty constructor to your class i.e. one that takes no arguments:
public ReminderService() {
super("ReminderService");
}
Explanation from the documentation:
The name
is used to name the worker thread.
NOTE: this is only applicable to intent service.
Declare a default no-argument constructor for IntentService
public class ReminderService extends IntentService {
public ReminderService() {
super("ReminderService");
}
}