{"id":160,"date":"2013-04-11T19:34:11","date_gmt":"2013-04-11T10:34:11","guid":{"rendered":"https:\/\/www.united-bears.co.jp\/blog\/?p=160"},"modified":"2013-04-11T19:34:11","modified_gmt":"2013-04-11T10:34:11","slug":"%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e3%81%a8%e3%81%8d%e3%81%ab%e3%82%84%e3%81%a3%e3%81%a6%e3%81%97%e3%81%be%e3%81%a3%e3%81%9f%e9%96%93%e9%81%95-2","status":"publish","type":"post","link":"https:\/\/www.united-bears.co.jp\/blog\/archives\/160","title":{"rendered":"\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u3068\u304d\u306b\u3084\u3063\u3066\u3057\u307e\u3063\u305f\u9593\u9055\u3044\uff5e\u305d\u306e2\uff5e"},"content":{"rendered":"<p><a href=\"https:\/\/www.united-bears.co.jp\/blog\/archives\/149\" target=\"_blank\">\u524d\u56de<\/a>\u306f\u3001\u672c\u5bb6\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u300cCreating a Dialog Fragment\u300d\u306e\u6587\u5b57\u3092\u898b\u305f\u3068\u3053\u308d\u307e\u3067\u8a18\u8ff0\u3057\u305f\u3068\u601d\u3046\u3002<br \/>\nFragment \u3092\u5229\u7528\u3059\u308b\u3053\u3068\u81ea\u4f53\u306f\u96e3\u3057\u304f\u306a\u304f<strong>Activity \u3092\u4f5c\u6210\u3059\u308b\u3068\u304d\u306bFragmentActivity\u3092\u7d99\u627f<\/strong>\u3057\u3001<strong>\u8868\u793a\u3059\u308b\u30c0\u30a4\u30a2\u30ed\u30b0\u306fDialogFragment\u3092\u7d99\u627f<\/strong>\u3059\u308b\u3060\u3051\u3060\u3002\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3057\u305f\u3044\u3068\u304d\u306f\u3001DialogFragment.show()\u3092\u547c\u3073\u51fa\u305b\u3070\u3088\u3044\u3002<\/p>\n<pre>FragmentActivity activity = (FragmentActivity) getContext();\r\nDialogFragment fragment = HogeDialog.newInstance(&lt;\u9069\u5f53\u306a\u5f15\u6570&gt;);\r\nfragment.show(activity.getSupportFragmentManager(), &lt;\u9069\u5f53\u306a\u30bf\u30b0\u540d&gt;);<\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306f\u3001Fragment \u3092Android 2.2\u7cfb\u3067\u3082\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u300candroid.support.v4\u300d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5229\u7528\u3057\u3066\u3044\u308b(Fragment\u306fAndroid 3.0\u304b\u3089\u306e\u30b5\u30dd\u30fc\u30c8)\u3002\u5b9f\u306b\u60c5\u3051\u306a\u3044\u3068\u3053\u308d\u306b\u306f\u307e\u3063\u305f\u306e\u3060\u304c\u3001\u6700\u521d\u306fFragmentManager\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306bActivity.getFragmentManager()\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u305f\u3002\u53d6\u5f97\u3067\u304d\u308b\u306e\u306f\u3001\u300candroid.app.FragmentManager\u300d\u3060\u3002Activity \u3082 \u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u30af\u30e9\u30b9\u3082\u300candroid.support.v4\u300d\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u901a\u3089\u306a\u3044\u3002\u30a8\u30e9\u30fc\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u305f\u306e\u306f\u30fb\u30fb\u30fb<\/p>\n<blockquote><p>\n\u578b DialogFragment \u306e\u30e1\u30bd\u30c3\u30c9 show(FragmentManager, String) \u306f\u5f15\u6570 (FragmentManager, String) \u306b\u9069\u7528\u3067\u304d\u307e\u305b\u3093\n<\/p><\/blockquote>\n<p>\u610f\u5473\u304c\u308f\u304b\u3089\u306a\u3044\u3002\u9069\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u304b\u898b\u3048\u307e\u305b\u3093\u30fb\u30fb\u30fb<\/p>\n<p>\u60a9\u3080\u3053\u3068n\u6642\u9593\u3002\u300candroid.support.v4\u300d\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3060\u304b\u3089\u3001\u5f53\u7136Activity.getFragmentManager()\u3067\u300candroid.support.v4.app.FragmentManager\u300d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3068\u601d\u3063\u3066\u305f\u81ea\u5206\u304c\u3044\u3051\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u3002<a href=\"http:\/\/developer.android.com\/reference\/android\/support\/v4\/app\/FragmentActivity.html\" target=\"_blank\">android.support.v4.app.FragmentActivity<\/a>\u306e API \u306e\u8aac\u660e\u3092\u8aad\u3080\u3068\u3061\u3083\u3093\u3068\u66f8\u3044\u3066\u3042\u3063\u305f\u3002<\/p>\n<blockquote><p>\nWhen using this class as opposed to new platform&#8217;s built-in fragment and loader support, you must use the getSupportFragmentManager() and getSupportLoaderManager() methods respectively to access those features. <\/p><\/blockquote>\n<p>\u60a9\u3080\u3088\u308a\u8abf\u3079\u308d\u3063\u3066\u3053\u3068\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306f\u3001\u672c\u5bb6\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u300cCreating a Dialog Fragment\u300d\u306e\u6587\u5b57\u3092\u898b\u305f\u3068\u3053\u308d\u307e\u3067\u8a18\u8ff0\u3057\u305f\u3068\u601d\u3046\u3002 Fragment \u3092\u5229\u7528\u3059\u308b\u3053\u3068\u81ea\u4f53\u306f\u96e3\u3057\u304f\u306a\u304fActivity \u3092\u4f5c\u6210\u3059\u308b\u3068\u304d\u306bFragmen [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-android","category-android-develop"],"_links":{"self":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":10,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":170,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions\/170"}],"wp:attachment":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}