{"id":412,"date":"2015-04-28T20:09:13","date_gmt":"2015-04-28T11:09:13","guid":{"rendered":"http:\/\/www.nukoneko.info\/blog\/?p=412"},"modified":"2015-04-28T21:04:54","modified_gmt":"2015-04-28T12:04:54","slug":"dialogpreference%e3%81%a7%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab%e3%81%a8%e4%b8%8b%e9%83%a8%e3%83%9c%e3%82%bf%e3%83%b3%e3%82%92%e6%b6%88%e3%81%99","status":"publish","type":"post","link":"https:\/\/www.nukoneko.info\/blog\/?p=412","title":{"rendered":"DialogPreference\u3067\u30bf\u30a4\u30c8\u30eb\u3068\u4e0b\u90e8\u30dc\u30bf\u30f3\u3092\u6d88\u3059"},"content":{"rendered":"<p>PreferenceFragment \u3092\u4f7f\u3063\u3066\u8a2d\u5b9a\u753b\u9762\u3092\u4f5c\u308a\u3001<\/p>\n<p>DialogPreference\u3092\u30ab\u30b9\u30bf\u30e0\u3057\u305f\u30d3\u30e5\u30fc\u3092\u8868\u793a\u3057\u305f\u6642\u306e\u8a71<\/p>\n<p><!--more--><\/p>\n<p>\u74b0\u5883\u306f Android Studio 1.1.0<br \/>\nActionBarActivity \u3092\u5229\u7528 (\u306a\u3093\u3067\u3082\u3044\u3044)<\/p>\n<p>\u8a2d\u5b9a\u30e1\u30cb\u30e5\u30fc<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;PreferenceScreen xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;&gt;\r\n    &lt;PreferenceCategory &gt;\r\n        &lt;info.nukoneko.test20150428.CustomDialogPreference android:title=&quot;\u30ab\u30b9\u30bf\u30e0\u30d3\u30e5\u30fc&quot; \/&gt;\r\n    &lt;\/PreferenceCategory&gt;\r\n&lt;\/PreferenceScreen&gt;\r\n<\/pre>\n<p>\u30ab\u30b9\u30bf\u30e0\u30d3\u30e5\u30fc<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class CustomDialogPreference extends DialogPreference {\r\n    public CustomDialogPreference(Context context, AttributeSet attrs) {\r\n        super(context, attrs);\r\n    }\r\n\r\n    public CustomDialogPreference(Context context, AttributeSet attrs, int defStyleAttr) {\r\n        super(context, attrs, defStyleAttr);\r\n    }\r\n    @Override\r\n    protected View onCreateDialogView(){\r\n        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n        return inflater.inflate(R.layout.custom_dialog, null);\r\n    }\r\n}\r\n<\/pre>\n<p>\u307e\u305a\u666e\u901a\u306b\u4f5c\u3063\u305f\u3002<br \/>\n<a href=\"http:\/\/www.nukoneko.info\/blog_d\/wp-content\/uploads\/2015\/04\/Screenshot_2015-04-28-19-59-22.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.nukoneko.info\/blog_d\/wp-content\/uploads\/2015\/04\/Screenshot_2015-04-28-19-59-22-150x150.png\" alt=\"Screenshot_2015-04-28-19-59-22\" width=\"150\" height=\"150\" class=\"aligncenter size-thumbnail wp-image-415\" \/><\/a><br \/>\n\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b\u3001<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n    setDialogTitle(null);\r\n    setNegativeButtonText(null);\r\n    setPositiveButtonText(null);\r\n<\/pre>\n<p>\u3092\u8ffd\u52a0<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n    public CustomDialogPreference(Context context, AttributeSet attrs) {\r\n        super(context, attrs);\r\n        setDialogTitle(null);\r\n        setNegativeButtonText(null);\r\n        setPositiveButtonText(null);\r\n    }\r\n\r\n    public CustomDialogPreference(Context context, AttributeSet attrs, int defStyleAttr) {\r\n        super(context, attrs, defStyleAttr);\r\n        setDialogTitle(null);\r\n        setNegativeButtonText(null);\r\n        setPositiveButtonText(null);\r\n    }\r\n<\/pre>\n<p>\u6d88\u3048\u307e\u3057\u305f\u3002<br \/>\n<a href=\"http:\/\/www.nukoneko.info\/blog_d\/wp-content\/uploads\/2015\/04\/Screenshot_2015-04-28-20-01-39.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.nukoneko.info\/blog_d\/wp-content\/uploads\/2015\/04\/Screenshot_2015-04-28-20-01-39-150x150.png\" alt=\"Screenshot_2015-04-28-20-01-39\" width=\"150\" height=\"150\" class=\"aligncenter size-thumbnail wp-image-417\" \/><\/a><br \/>\n\u2461 XML<br \/>\nJava \u306f\u6700\u521d\u306e CustomDialogPreference \u3092\u5229\u7528<\/p>\n<p>\u8a2d\u5b9a\u30e1\u30cb\u30e5\u30fc\u306eXML\u3092<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;PreferenceScreen xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;&gt;\r\n    &lt;PreferenceCategory &gt;\r\n        &lt;info.nukoneko.test20150428.CustomDialogPreference android:title=&quot;\u30ab\u30b9\u30bf\u30e0\u30d3\u30e5\u30fc&quot;\r\n            android:dialogTitle=&quot;&quot;\r\n            android:negativeButtonText=&quot;@null&quot;\r\n            android:positiveButtonText=&quot;@null&quot;\/&gt;\r\n    &lt;\/PreferenceCategory&gt;\r\n&lt;\/PreferenceScreen&gt;\r\n<\/pre>\n<p>\u3053\u3046\u3059\u308b\u3002<\/p>\n<p>\u6d88\u3048\u305f(\u624b\u629c\u304d)<br \/>\n<a href=\"http:\/\/www.nukoneko.info\/blog_d\/wp-content\/uploads\/2015\/04\/Screenshot_2015-04-28-20-01-39.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.nukoneko.info\/blog_d\/wp-content\/uploads\/2015\/04\/Screenshot_2015-04-28-20-01-39-150x150.png\" alt=\"Screenshot_2015-04-28-20-01-39\" width=\"150\" height=\"150\" class=\"aligncenter size-thumbnail wp-image-417\" \/><\/a><\/p>\n<p>\u3067\u306f\u3067\u306f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PreferenceFragment \u3092\u4f7f\u3063\u3066\u8a2d\u5b9a\u753b\u9762\u3092\u4f5c\u308a\u3001 DialogPreference\u3092\u30ab\u30b9\u30bf\u30e0\u3057\u305f\u30d3\u30e5\u30fc\u3092\u8868\u793a\u3057\u305f\u6642\u306e\u8a71<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,31],"tags":[],"class_list":["post-412","post","type-post","status-publish","format-standard","hentry","category-android-2","category-java"],"_links":{"self":[{"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=412"}],"version-history":[{"count":4,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/412\/revisions"}],"predecessor-version":[{"id":418,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/412\/revisions\/418"}],"wp:attachment":[{"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nukoneko.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}