Start android application without activity

前端 未结 3 1544
温柔的废话
温柔的废话 2020-11-30 01:24

I\'ve an application which aims to run only as a service (no interface, just run in background). I have no activity mentioned in my AndroidManifest.xml but put a receiver to

3条回答
  •  孤独总比滥情好
    2020-11-30 01:54

    Starting The service using Broadcast receiver through any Intent like

    android.intent.action.BOOT_COMPLETED

    is not possible above Android 3.1 until the user uses your app, and thus to use your app there must be a single non UI activity (which can call finish in oncreate()).

    See the proof here

提交回复
热议问题