Created
July 25, 2012 13:42
-
-
Save chrisjenx/3176258 to your computer and use it in GitHub Desktop.
Restart activity from fragment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Post it in a handler to make sure it gets called if coming back from a lifecycle method. | |
new Handler().post(new Runnable() { | |
@Override | |
public void run() | |
{ | |
Intent intent = getActivity().getIntent(); | |
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | |
| Intent.FLAG_ACTIVITY_NO_ANIMATION); | |
getActivity().overridePendingTransition(0, 0); | |
getActivity().finish(); | |
getActivity().overridePendingTransition(0, 0); | |
startActivity(intent); | |
} | |
}); |
Thank you dude, you are Awesome.
Thank you
Thanks a lot!
Thanks
Thanks a lot.
Thanks a lot
thank you, my friend.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice, thank you so much!!