{"id":440,"date":"2018-08-07T01:00:38","date_gmt":"2018-08-06T16:00:38","guid":{"rendered":"http:\/\/www.hundredapps.net\/?p=440"},"modified":"2026-10-23T02:16:22","modified_gmt":"2026-10-22T17:16:22","slug":"fragment%e3%81%ae%e7%b5%82%e4%ba%86%e5%87%a6%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.hundredapps.net\/?p=440","title":{"rendered":"Fragment\u306e\u7d42\u4e86\u51e6\u7406"},"content":{"rendered":"<p>\u3044\u3064\u3082\u5fd8\u308c\u3066\u3057\u307e\u3046Fragment\u306e\u7d42\u4e86\u306e\u66f8\u304d\u65b9<\/p>\n<p>\u305d\u306eFragment\u81ea\u8eab\u3067\u7d42\u4e86\u3057\u305f\u3044\u5834\u5408<\/p>\n<pre>\r\ngetFragmentManager().beginTransaction().remove(this).commit();\r\n\r\n<\/pre>\n<p>backstack\u3042\u308a\u306e\u5834\u5408<\/p>\n<pre>\r\ngetFragmentManager().popBackStack();\r\n\r\n<\/pre>\n<p>\u547c\u3073\u51fa\u3057\u5143\u306eActivity\u3067\u3001Fragment\u3092\u7d42\u4e86\u3055\u305b\u305f\u3044\u5834\u5408(Back Key\u306e\u6642\u306a\u3069)<\/p>\n<pre>\r\nFragment hogeFragment = getFragmentManager().findFragmentByTag(HogeFragment.TAG);\r\nif (hogeFragment != null) {\r\n    getFragmentManager().beginTransaction().remove(hogeFragment).commit();\r\n    \r\n    or\r\n \r\n    hogeFragment.popBackStack(); \r\n}\r\n\r\n<\/pre>\n<p>v4\u306esupport library\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3042\u308c\u3070\u3001<br \/>\ngetFragmentManager() -> getSupportFragmentManager()\u306b\u5909\u66f4<br \/>\n(\u3082\u3046\u3053\u306e\u6642\u671f\u306b\u3001api level16\u4ee5\u4e0b\u306e\u30b5\u30dd\u30fc\u30c8\u306f\u306a\u3044\u304b\u306a\u3002\u3002\u30a2\u30eb\u30ab\u30ca\u3002\u3002)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3044\u3064\u3082\u5fd8\u308c\u3066\u3057\u307e\u3046Fragment\u306e\u7d42\u4e86\u306e\u66f8\u304d\u65b9 \u305d\u306eFragment\u81ea\u8eab\u3067\u7d42\u4e86\u3057\u305f\u3044\u5834\u5408 getFragme&#8230;<\/p>\n","protected":false},"author":1,"featured_media":405,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-440","post","type-post","status-publish","format-standard","has-post-thumbnail","category-android-tips","article cf"],"_links":{"self":[{"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/posts\/440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=440"}],"version-history":[{"count":6,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/posts\/440\/revisions"}],"predecessor-version":[{"id":868,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/posts\/440\/revisions\/868"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/media\/405"}],"wp:attachment":[{"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}