Android - When launch the same activity from widget with different extras, how to prevent the same instance show up after returned from HOME button?

前端 未结 5 1832
我在风中等你
我在风中等你 2021-01-13 12:52

I have a widget that contains 4 buttons to show 4 stock prices, each of them will launch into the same activity Quote.class to show stock details. In onUpdate(), it will set

5条回答
  •  不思量自难忘°
    2021-01-13 13:48

    When you press home, most probably the activity will not be destroyed. It is put to pause state in such case. So, I guess your code to initiate the stock view would stationed in onCreate rather than onResume. So, moving those to onResume should solve the problem.

提交回复
热议问题