Can I start a service without activity or receiver?

前端 未结 2 1431
执笔经年
执笔经年 2020-12-17 23:00

I want to start a service in an APK.

I tried to use as following:



        
2条回答
  •  粉色の甜心
    2020-12-17 23:26

    No you can't.

    Create a simple Activity which starts the service and simply provides some feedback to the user (to tell them the service has started for example) and set that Activity with the MAIN/LAUNCHER intent.

提交回复
热议问题