What is the equivalent of
finish()
for a fragment activity in
OnPause();
I cant find it anywhere, I just want the fragment to end when it is paused
As others have already stated, call finish() as you would in a regular Activity. In regards to the onPause() part of your question, I'm not sure what you are looking for, but it might be a good idea to review the lifecycles of Activities and Fragments...
Activity Lifecycle
http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle
Fragment Lifecycle
http://developer.android.com/reference/android/app/Fragment.html#Lifecycle
call this line and it will kill the current fragment
getActivity().finish();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With