Start service in Android

前端 未结 5 1520
醉梦人生
醉梦人生 2020-11-27 14:07

I want to call a service when a certain activity starts. So, here\'s the Service class:

public class UpdaterServiceManager extends Service {

    private fin         


        
5条回答
  •  生来不讨喜
    2020-11-27 14:21

    startService(new Intent(this, MyService.class));
    

    Just writing this line was not sufficient for me. Service still did not work. Everything had worked only after registering service at manifest

    
    
        ...
    
        
        
    
    

提交回复
热议问题