Bring application to front after user clicks on home button

后端 未结 7 913
礼貌的吻别
礼貌的吻别 2020-11-28 09:21

My application is in running mode[foreground] and user clicks on home button, which puts application to background[and still running]. I ha

7条回答
  •  误落风尘
    2020-11-28 10:01

    For an alarm, you want to take a look at starting an Android Service

    This service will be more resilient than your application which may be killed while in the background and can fire off an intent to bring your application to the front (or restart it if it was killed) when it is time for the alarm to go off.

提交回复
热议问题