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 can reach the single instance aim, but it won't update the view of the activity.
This activity is launched by startActivityForResult
, and we send the URI with the intent to the activity.
Let's discuss with this certain case:
My request is not to destroy the old activity, but the activity that just received the new intent infomation should refresh the view.
I found a new method, onNewIntent
.
This method can refresh the intent before resume. I will try it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…