Check whether activity is active

前端 未结 8 2277
眼角桃花
眼角桃花 2020-11-27 04:47

I\'m having a problem with a listener in a certain activity.

The problem is that this listener contains an alert.show(); which can be called after we try to push a

8条回答
  •  野性不改
    2020-11-27 05:18

    Yes you can check if activity is active: Refreshing an Activity from service when Active

    Also, if your are not doing anything when your Activity in not active, then you should probably unregister the listener when your Activity deactivates.

提交回复
热议问题