Why we pass super((String)IntentServiceClassName ) in constructor while extending IntentService class in Android.
Why we use that construtor empty. and why with name >??
public class MyService extends IntentService {
public static final int STATUS_RUNNING = 0;
public static final int STATUS_FINISHED = 1;
public static final int STATUS_ERROR = 2;
private static final String TAG = "MyService";
public MyService() {
super(MyService.class.getName());
//or super("MyService");
}
Because we have to instantiate the constructor of the parent class too to notify it that its child class has been created...
In java if you do not provide the super as the first statement the compiler automatically attach this statement as the first line after compilation...