meluluji
meluluji

Reputation: 319

Close activities after clicking a button inside a Dialog in c#

I have 3 activities: A -> B -> C When I'm in "C" I can go back to edit some values if I want, but after click a button in C it shows me a Dialog with a button that it says something like "Okay, you did good, your data is processing now". After clicking the button inside the dialog I want to close A, B and C. I've read about NoHistory and applying that, I can't go back to edit the values, so I can't use it in this case. What should I do? Thank you in advance.

Upvotes: 0

Views: 59

Answers (1)

M. Palsich
M. Palsich

Reputation: 1818

When setting up your intent to launch a new activity by pressing the confirmation button, set these intent flags before calling startActivity():

yourIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);

These flags force the associated activity task to be cleared, and start a new task with this intent. More on Intent flags can be found in the Android Developers documentation: https://developer.android.com/reference/android/content/Intent.html.

Upvotes: 1

Related Questions