what is the right way to clear background activity/activites from stack?

后端 未结 3 1465
旧时难觅i
旧时难觅i 2021-01-07 00:30

as the questions title says - I need to know what is the best way to \"remove\"/destroy/finish an activity that are somewhere in the middle of stack and currently on pause

3条回答
  •  耶瑟儿~
    2021-01-07 01:01

    Make a custom Broadcast receiver and register it in every activity which can be fired on event of your choice. in onReceiveMethod of every activity (may be selected )just call finish(). In this your activities will be removed from the stack. Further you can visit this for more help: On logout, clear Activity history stack, preventing "back" button from opening logged-in-only Activites

提交回复
热议问题