How to keep a single activity instance but be able to update the view?

前端 未结 2 1475
萌比男神i
萌比男神i 2020-12-13 13:14

In my situation, there is one case in which I need to make sure the activity only runs one at a time.

I found if I set the LauchMode of the activity, I

2条回答
  •  半阙折子戏
    2020-12-13 14:01

    You can have an Activity with a manifest attribute of singleInstance. As soon as the activity is relaunched , onResume gets called. You can update the view with the new image and invalidate the older View.

    
    

提交回复
热议问题