LoginSignup
35
33

More than 5 years have passed since last update.

Fragment自身を終了させる

Last updated at Posted at 2014-11-08

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

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

で出来た

追記

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

getFragmentManager().popBackStack();
35
33
3

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
  3. You can use dark theme
What you can do with signing up
35
33