0
AndroidでIntentServiceクラスを拡張している間に、コンストラクタでsuper((String)IntentServiceClassName)を渡す理由AndroidでIntentServiceクラスを拡張しながら、コンストラクタでsuper((String)IntentServiceClassName)を渡す理由
私たちはなぜそのコンストラクタを空にするのですか?そしてなぜ名前>?
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");
}
すべてのクラスは、その親クラスのサブクラスです。 –
しかし、なぜ我々はスーパーで名前を取得する必要がありますか?私たちはすでに拡大しています。 –
親IntentServiceクラスを呼び出し、その子サービスが次のクラスを処理しました。 –