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 1874
我在风中等你
我在风中等你 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:55

    You can try this:

            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    

    Your activity will not be seen in the history stack

提交回复
热议问题