我想启动一个包含参数的服务
public BackgroundHelperService(String name)
如何使用
执行此操作Intent service = new Intent(cnx, BackgroundHelperService.class);
我无法传递名称参数。
答案 0 :(得分:1)
我无法传递名称参数。
正确。您无法传递构造函数参数。如果BackgroundHelperService
正在延长IntentService
,请自行提供名称:
public BackgroundHelperService() {
super("BackgroundHelperService");
}