How to clear Intent that started Activity?

后端 未结 9 1282
攒了一身酷
攒了一身酷 2021-02-03 21:07

At the beginning Activity is launched by an Intent and something is done with this Intent.

When I change orientation of my Activity, it\'s reloaded again and Intent is

9条回答
  •  轮回少年
    2021-02-03 21:54

    Old post, but some one could use this.

    Dont waste time, if your app is resumed, the intent will be there again.

    Use the starting intent on the "Activity Resume", and just add an extra value

    putExtra("DONE", 0)
    

    And each time your app resumes, check if already has this value:

    hasExtra("DONE")
    

    easy

提交回复
热议问题