How to instantiate android service with a constructor?

后端 未结 6 1949
北海茫月
北海茫月 2021-01-04 09:21

I have a service with an following constructor:

public ShimmerService(Context context, Handler handler) {
    mHandler = handler;
}

I want

6条回答
  •  生来不讨喜
    2021-01-04 09:49

    You need to have a no-argument constructor for your Service class, otherwise the systems doesn't know how to instantiate it.

提交回复
热议问题