LoginSignup
32

More than 5 years have passed since last update.

posted at

updated at

Fragment自身を終了させる

Fragment自身でActivityで言うところのfinish()を実行したい

getFragmentManager().beginTransaction().remove(this).commit();

で出来た

追記

backstackがある場合は以下の方がいいでしょう

getFragmentManager().popBackStack();

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
32