{"id":2951,"date":"2022-06-29T15:08:16","date_gmt":"2022-06-29T06:08:16","guid":{"rendered":"https:\/\/bunktiruu.com\/?p=2951"},"modified":"2022-09-02T15:02:51","modified_gmt":"2022-09-02T06:02:51","slug":"%e3%80%90android%e3%82%a2%e3%83%97%e3%83%aa%e9%96%8b%e7%99%ba%e3%80%91%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%82%92%e3%83%9d%e3%83%83%e3%83%97%e3%82%a2%e3%83%83%e3%83%97%e3%81%a7%e5%87%ba","status":"publish","type":"post","link":"https:\/\/bunktiruu.com\/?p=2951","title":{"rendered":"\u3010Android\u30a2\u30d7\u30ea\u958b\u767a\u3011\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3067\u51fa\u3057\u305f\u3044 \u4ee4\u548c4\u5e74\u7248\uff08Java\uff09"},"content":{"rendered":"\n<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u30af\u30ea\u30a8\u30a4\u30bf\u30fc\u306e\u3068\u3082\u3059\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>Android\u30a2\u30d7\u30ea\u306e\u958b\u767a\u74b0\u5883\u306f\u3001\u6570\u5e74\u524d\u306e\u77e5\u8b58\u304c\u3057\u308c\u3063\u3068\u4f7f\u3048\u306a\u304f\u306a\u3063\u3066\u3044\u305f\u308a\u3057\u307e\u3059\u3002\u305d\u306e\u7406\u7531\u306fGoogle\u304cAPI\u3092\u3061\u3087\u3044\u3061\u3087\u3044\u5909\u66f4\u3059\u308b\u304b\u3089\u306a\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u306f\u56de\u907f\u3067\u304d\u308b\u30e2\u30ce\u3067\u306f\u306a\u3044\u304b\u3089\u4ed8\u3044\u3066\u3044\u304f\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3044\u307e\u3001\u3068\u3042\u308b\u524a\u9664\u51e6\u7406\u3092\u3059\u308b\u306e\u306b\u78ba\u8a8d\u306e\u305f\u3081\u306e\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3092\u3055\u305b\u305f\u304f\u3066\u3001\u8abf\u3079\u3066\u30b3\u30fc\u30c9\u66f8\u3044\u3066\u52d5\u4f5c\u3059\u308b\u306e\u3092\u78ba\u8a8d\u3057\u305f\u306e\u3067\u5171\u6709\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ee4\u548c4\u5e74\u7248\u3068\u66f8\u3044\u305f\u306e\u306f\u3001\u3053\u3046\u3044\u3046\u6280\u8853\u60c5\u5831\u306f\u3059\u3050\u53e4\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u60c5\u5831\u304c\u65b0\u3057\u3044\u306e\u304b\u53e4\u3044\u306e\u304b\u3092\u5224\u65ad\u3057\u3066\u3082\u3089\u3044\u305f\u304f\u3066\u30bf\u30a4\u30c8\u30eb\u306b\u8a18\u8f09\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306b\u306f1\u884c\u76ee\u306epackage\u6587\u304c\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u8a66\u3057\u305f\u3044\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u8a18\u8f09\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre title=\"DeleteCheckDialogFragment.java\" class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">import android.app.Dialog;\nimport android.content.Context;\nimport android.os.Bundle;\nimport android.widget.Toast;\n\nimport androidx.appcompat.app.AlertDialog;\nimport androidx.fragment.app.DialogFragment;\n\npublic class DeleteCheckDialogFragment extends DialogFragment {\n    private Context context;\n\n    public DeleteCheckDialogFragment(Context context) {\n        this.context = context;\n    }\n    @Override\n    public Dialog onCreateDialog(Bundle savedInstanceState) {\n        \/\/ Use the Builder class for convenient dialog construction\n        AlertDialog.Builder builder = new AlertDialog.Builder(context);\n        builder.setTitle(\"\u78ba\u8a8d\")\n                .setMessage(\"\u6d88\u3057\u307e\u3059\u304b\uff1f\")\n                .setPositiveButton(\"\u306f\u3044\", (dialog, id) -&gt; {\n                    Toast.makeText(context, \"\u306f\u3044\u304c\u62bc\u3055\u308c\u305f\", Toast.LENGTH_SHORT).show();\n                })\n                .setNegativeButton(\"\u3044\u3044\u3048\", (dialog, id) -&gt; {\n                    Toast.makeText(context, \"\u3044\u3044\u3048\u304c\u62bc\u3055\u308c\u305f\", Toast.LENGTH_SHORT).show();\n                });\n        \/\/ Create the AlertDialog object and return it\n        return builder.create();\n    }\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u4e0a\u8a18\u8a18\u8ff0\u3060\u3051\u3067\u306f\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30c0\u30a4\u30a2\u30ed\u30b0\u306f\u51fa\u307e\u305b\u3093\u3002\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002<span class=\"ystdb-inline--3\">\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092MainActivity\u306a\u3069\u306b\u8a18\u8f09<\/span>\u3059\u308c\u3070\u52d5\u4f5c\u3059\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>1\u884c\u76ee\u306eContext\u306f\u3001MainActivity\u5185\u3067\u3042\u308c\u3070\u300cthis\u300d\u3067Context\u304c\u5f97\u3089\u308c\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u3067\u306f\u9069\u6642\u4e0a\u624b\u304f\u3084\u3063\u3066\u304f\u3060\u3055\u3044\u3002getApplicationContext()\u3068\u304b\u306d\u2026\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">Context context = this;\nFragmentManager fragmentManager = getSupportFragmentManager();\nDeleteCheckDialogFragment fragment = new DeleteCheckDialogFragment(context);\nfragment.show(fragmentManager, \"TAG_NAME\");<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3053\u3046\u3044\u3046\u306e\u3092\u66f8\u3044\u3066\u3044\u308b\u3068\u3001\u8aad\u307f\u624b\u3055\u3093\u304b\u3089<\/p>\n\n\n\n<div class=\"ystdb-balloon is-vertically-aligned-top is-balloon-position-right\"><figure class=\"ystdb-balloon__avatar is-size-large\"><img decoding=\"async\" class=\"ystdb-balloon__avatar-image\" src=\"https:\/\/bunktiruu.com\/wp-content\/uploads\/2021\/04\/fukidasi_tomosuke_komatta.jpeg\" alt=\"tomosuke\"\/><figcaption class=\"ystdb-balloon__name\">tomosuke<\/figcaption><\/figure><div class=\"ystdb-balloon__body is-top is-right is-serif\"><p class=\"ystdb-balloon__text\">\u3044\u3084\u3001Toast\u3059\u308b\u3060\u3051\u3058\u3083\u4f55\u3082\u3067\u304d\u306a\u3044\u3058\u3083\u3093\u3002\u3082\u3063\u3068\u73fe\u5834\u3067\u4f7f\u3048\u305d\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3088<\/p><\/div><\/div>\n\n\n\n<p>\u3068\u304b\u601d\u308f\u308c\u305d\u3046\u3067\u3059\u304c\uff08\u305d\u3093\u306a\u3053\u3068\u306f\u306a\u3044\uff1f\uff09\u3001\u53d6\u308a\u6025\u304e\u81ea\u5206\u30e1\u30e2\u3068\u3057\u3066\u30a2\u30c3\u30d7\u3057\u305f\u306e\u3067\u3054\u4e86\u627f\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u307e\u305f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2022\u5e746\u6708\u306e\u6642\u70b9\u3067\u306e\u6700\u65b0\u74b0\u5883\u306b\u3066\u52d5\u4f5c\u78ba\u8a8d\u3057\u305f\u3001\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3055\u305b\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":2954,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[264,247],"class_list":{"0":"post-2951","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-develop","8":"tag-android","9":"tag-java"},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/posts\/2951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2951"}],"version-history":[{"count":7,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/posts\/2951\/revisions"}],"predecessor-version":[{"id":3120,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/posts\/2951\/revisions\/3120"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/media\/2954"}],"wp:attachment":[{"href":"https:\/\/bunktiruu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}