This is a follow up question to this question:
Force application to restart on first activity
I am trying to restart my application from a fragment like that:
Once you add this FLAGS
to the intent
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
and call startActivity()
, it will clear all the other activities including the one you call this from, so calling finish()
after startActivity()
will close the started activity.
Basically, remove getActivity().finish()
.