Bring application back to front

前端 未结 3 1879
轮回少年
轮回少年 2021-02-19 14:18

My application is a timer with alarm type app. When the timer expires i would like to bring the app\'s main activity back into view, if the user has navigated away, but the app

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-19 15:10

    See http://developer.android.com/guide/appendix/faq/framework.html#4:

    How can I check if an Activity is already running before starting it?

    The general mechanism to start a new activity if its not running— or to bring the activity stack to the front if is already running in the background— is the to use the NEW_TASK_LAUNCH flag in the startActivity() call.

提交回复
热议问题