最佳答案
通常,当我创建一个 Android 服务时,我会实现 onCreate
方法,但在我上一个项目中,这个方法不起作用。我尝试实现 onStartCommand
,这似乎工作。
The question is: when I have to implement a service which method is required? Which methods I have to implement? onCreate
, onStartCommand
, or both? And what is the role of each?