I want to start a service that has parameters
public BackgroundHelperService(String name)
How can I do this using
Intent service = new Intent(cnx, BackgroundHelperService.class);
I cannot pass the name param.
I cannot pass the name param.
Correct. You cannot pass constructor parameters. If BackgroundHelperService
is extending IntentService
, please supply a name yourself:
public BackgroundHelperService() {
super("BackgroundHelperService");
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.