prabu
prabu

Reputation: 727

Is it possible to finish Fragment class in android?

Normally if we would like to close the activity means what we will do, we will simply call

finish()

method right.Likewise,how can we finish or close a FRAGMENT class.

Suggestion please..

Thanks for your precious time!..

Upvotes: 1

Views: 1262

Answers (2)

Ranjithkumar
Ranjithkumar

Reputation: 707

getActivity().finish()

Use this method

Upvotes: 0

Flitzpiepe
Flitzpiepe

Reputation: 167

Just a suggestion:

http://developer.android.com/reference/android/app/FragmentTransaction.html#remove%28android.app.Fragment%29

You normally start a fragment via FragmentManager and FragmentTransactions - you can probably use the remove command from FragmentTransactions

Upvotes: 1

Related Questions