{"id":931,"date":"2023-09-20T16:19:12","date_gmt":"2023-04-09T06:42:33","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/"},"modified":"2025-08-01T03:38:11","modified_gmt":"2025-07-31T18:38:11","slug":"kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/","title":{"rendered":"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002"},"content":{"rendered":"<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Alert Dialogs\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u3001Kotlin\u3092\u4f7f\u7528\u3057\u3066Android\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<h2>\u8b66\u544a\u30c0\u30a4\u30a2\u30ed\u30b0<\/h2>\n<p>\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u306f\u753b\u9762\u4e0a\u306b\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3059\u308b\u30a6\u30a3\u30f3\u30c9\u30a6\u3067\u3059\u3002\u901a\u5e38\u3001\u60c5\u5831\u3092\u8868\u793a\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u6c42\u3081\u307e\u3059\u3002\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u69cb\u6210\u3059\u308b\u4e3b\u8981\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f3\u3064\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>Title Text<\/li>\n<li>Message Text<\/li>\n<li>Buttons &#8211; There are three types of buttons: Positive, Negative, and Neutral<\/li>\n<\/ul>\n<p>AlertDialog\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001AlertDialog.Builder\u5185\u90e8\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>val alertDialogBuilder = AlertDialog.Builder(this)\r\n<\/code><\/pre>\n<p>\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30fc\u5185\u306b\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u6e21\u3057\u307e\u3059\u3002\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u30b9\u30bf\u30a4\u30eb\u3092\u5225\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3068\u3057\u3066\u6e21\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u30e1\u30bd\u30c3\u30c9<\/h2>\n<p>\u300cAlertDialog\u300d\u3067\u4f7f\u7528\u3067\u304d\u308b\u3044\u304f\u3064\u304b\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>setTitle<\/li>\n<li>setMessage<\/li>\n<li>setIcon<\/li>\n<li>setCustomTitle &#8211; Here you can pass a custom view that\u2019ll be put in place of the title part in the alert dialog.<\/li>\n<li>setPositiveButton &#8211; We pass the string name, as well as Button, clicked callback method here.<\/li>\n<li>setView &#8211; used to add a custom view inside the alert dialog.<\/li>\n<li>setList &#8211; used to set an array of strings which would be displayed in the form of a List.<\/li>\n<li>setMultiChoiceList &#8211; again we can set an array but this time we can select multiple items from the List thanks to CheckBox.<\/li>\n<li>setPositiveButtonIcon &#8211; set an icon alongside the Button<\/li>\n<li>show() &#8211; used to display the AlertDialog<\/li>\n<li>setDismissListener &#8211; Inside this, you can set the logic to be triggered when the alert dialog is dismissed.<\/li>\n<li>setShowListener &#8211; set the logic to be triggered when the alert dialog is dismissed.<\/li>\n<li>setCancelable &#8211; requires a boolean value. By default all alert dialogs are cancelable on button click or touch outside. If this method is set to false, you need to explicitly cancel the dialog using dialog.cancel() method.<\/li>\n<\/ul>\n<h2>\u30a2\u30e9\u30fc\u30c8 \u30c0\u30a4\u30a2\u30ed\u30b0\u306e Kotlin \u30b3\u30fc\u30c9\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/h2>\n<p>AlertDialog\u3092Android Studio\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u30af\u30e9\u30b9\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>import android.support.v7.app.AlertDialog;\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306eKotlin\u30b3\u30fc\u30c9\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>val builder = AlertDialog.Builder(this)\r\nbuilder.setTitle(\"Androidly Alert\")\r\nbuilder.setMessage(\"We have a message\")\r\n\/\/builder.setPositiveButton(\"OK\", DialogInterface.OnClickListener(function = x))\r\n\r\nbuilder.setPositiveButton(android.R.string.yes) { dialog, which -&gt;\r\n    Toast.makeText(applicationContext,\r\n            android.R.string.yes, Toast.LENGTH_SHORT).show()\r\n}\r\n        \r\nbuilder.setNegativeButton(android.R.string.no) { dialog, which -&gt;\r\n    Toast.makeText(applicationContext,\r\n            android.R.string.no, Toast.LENGTH_SHORT).show()\r\n}\r\n\r\nbuilder.setNeutralButton(\"Maybe\") { dialog, which -&gt;\r\n    Toast.makeText(applicationContext,\r\n            \"Maybe\", Toast.LENGTH_SHORT).show()\r\n}\r\nbuilder.show()\r\n<\/code><\/pre>\n<p>builder.show()\u306f\u3001\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u753b\u9762\u306b\u8868\u793a\u3057\u307e\u3059\u3002setPositiveButton\u95a2\u6570\u306e\u5185\u90e8\u3067\u306f\u3001\u30dc\u30bf\u30f3\u306e\u30c6\u30ad\u30b9\u30c8\u3068\u3068\u3082\u306b\u3001\u305d\u306e\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3068\u304d\u306b\u30c8\u30ea\u30ac\u30fc\u3055\u308c\u308bKotlin\u95a2\u6570\u3092\u6e21\u3057\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u306fDialogInterface.OnClickListener()\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u4e00\u90e8\u3067\u3059\u3002\u95a2\u6570\u306e\u30bf\u30a4\u30d7\u306f(DialogInterface, Int) -&gt; Unit\u3067\u3059\u3002DialogInterface\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308a\u3001Int\u306f\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u30dc\u30bf\u30f3\u306eID\u3067\u3059\u3002\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u3053\u306e\u95a2\u6570\u3092\u30cf\u30a4\u30aa\u30fc\u30c0\u30fc\u306aKotlin\u95a2\u6570\u3068\u3057\u3066\u8868\u73fe\u3057\u3066\u3044\u307e\u3059\u3002dialog\u3068which\u306f\u4e8c\u3064\u306e\u5f15\u6570\u3092\u8868\u3057\u307e\u3059\u3002\u5f15\u6570\u304c\u4f7f\u7528\u3055\u308c\u306a\u3044\u5834\u5408\u306b\u306f\u3001_\u3092\u6e21\u3059\u3053\u3068\u3067\u95a2\u6570\u3092\u6539\u5584\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u3088\u3046\u306a\u95a2\u6570\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>builder.setPositiveButton(android.R.string.yes) { _,_ -&gt;\r\n            Toast.makeText(applicationContext,\r\n                    android.R.string.yes, Toast.LENGTH_SHORT).show()\r\n        }\r\n<\/code><\/pre>\n<p>\u9078\u629e\u80a2\u3068\u3057\u3066\u306f\u3001AlertDialog\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f7f\u3063\u3066Dialog\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002builder.show()\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>val alertDialog = builder.create()\r\nalertDialog.show()\r\n<\/code><\/pre>\n<p>\u30dc\u30bf\u30f3\u306e\u30af\u30ea\u30c3\u30af\u30ea\u30b9\u30ca\u30fc\u95a2\u6570\u3092\u5404\u30dc\u30bf\u30f3\u3054\u3068\u306b\u5b9a\u7fa9\u3059\u308b\u4ee3\u308f\u308a\u306b\u3001\u9ad8\u968e\u95a2\u6570\u3068\u3057\u3066\u5225\u3005\u306b\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>val positiveButtonClick = { dialog: DialogInterface, which: Int -&gt;\r\n    Toast.makeText(applicationContext,\r\n            android.R.string.no, Toast.LENGTH_SHORT).show()\r\n}\r\n<\/code><\/pre>\n<p>\u6b21\u306b\u3001\u3053\u306eval\u30d7\u30ed\u30d1\u30c6\u30a3\u3092setPositiveButton Kotlin\u95a2\u6570\u5185\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>builder.setPositiveButton(\"OK\", DialogInterface.OnClickListener(function = positiveButtonClick))\r\n\/\/or\r\nbuilder.setPositiveButton(android.R.string.yes, positiveButtonClick)\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/6564a67bdaa94e2bdf7c3fa4\/23-0.png\" alt=\"android basic alert dialog kotlin code\" \/><\/div>\n<p>\u30dc\u30bf\u30f3\u306e\u30af\u30ea\u30c3\u30af\u6642\u306b\u4f55\u306e\u51e6\u7406\u3082\u884c\u308f\u306a\u3044\u5834\u5408\u306f\u3001\u4ee3\u308f\u308a\u306bnull\u3092\u95a2\u6570\u306b\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Kotlin\u306f\u307e\u3060\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306b\u3088\u308a\u591a\u304f\u306e\u529b\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30b7\u30f3\u30d7\u30eb\u306a\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u306eKotlin\u30b3\u30fc\u30c9<\/h2>\n<p>with\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001Kotlin\u306e\u30b3\u30fc\u30c9\u3067\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f5c\u6210\u3059\u308b\u969b\u306e\u53ef\u8aad\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>fun basicAlert(view: View){\r\n\r\n        val builder = AlertDialog.Builder(this)\r\n        \r\n        with(builder)\r\n        {\r\n            setTitle(\"Androidly Alert\")\r\n            setMessage(\"We have a message\")\r\n            setPositiveButton(\"OK\", DialogInterface.OnClickListener(function = positiveButtonClick))\r\n            setNegativeButton(android.R.string.no, negativeButtonClick)\r\n            setNeutralButton(\"Maybe\", neutralButtonClick)\r\n            show()    \r\n        }\r\n        \r\n        \r\n    }\r\n<\/code><\/pre>\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001AlertDialog\u306b\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308bAndroid\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>Simple Alert Dialog<\/li>\n<li>Alert Dialog With Icon and Button Customisation<\/li>\n<li>Alert Dialog With List<\/li>\n<li>Alert Dialog With MultiChoice List<\/li>\n<li>Alert Dialog With Style<\/li>\n<li>Alert Dialog With Custom Style<\/li>\n<li>Alert Dialog With EditText<\/li>\n<\/ul>\n<h2>\u30a2\u30f3\u30c9\u30ed\u30a4\u30c9\u30b9\u30bf\u30b8\u30aa\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u69cb\u9020<\/h2>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/6564a67bdaa94e2bdf7c3fa4\/32-0.png\" alt=\"android basic alert dialog project structure\" \/><\/div>\n<h3>1. XML\u30ec\u30a4\u30a2\u30a6\u30c8\u30b3\u30fc\u30c9\u3092\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u3059\u308b<\/h3>\n<p>\u4e0b\u8a18\u306bactivity_main.xml\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u30b3\u30fc\u30c9\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:gravity=\"center\"\r\n    android:orientation=\"vertical\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/btnBasicAlert\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:onClick=\"basicAlert\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"BASIC ALERT DIALOG\" \/&gt;\r\n\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/btnAlertWithIconsAndCustomize\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:onClick=\"withIconAndCustomise\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"WITH ICON AND CUSTOMIZATION\" \/&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/btnAlertWithItems\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:onClick=\"withItems\"\r\n        android:text=\"WITH ITEMS\" \/&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/btnAlertWithMultiChoiceList\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:onClick=\"withMultiChoiceList\"\r\n        android:text=\"WITH MULTI CHOICE LIST\" \/&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/btnAlertWithStyle\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:onClick=\"withStyle\"\r\n        android:text=\"WITH STYLE\" \/&gt;\r\n\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/btnAlertWithCustomStyle\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:onClick=\"withCustomStyle\"\r\n        android:text=\"WITH CUSTOM STYLE\" \/&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/btnAlertWithButtonCentered\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:onClick=\"withButtonCentered\"\r\n        android:text=\"WITH BUTTON CENTERED\" \/&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/btnAlertWithEditText\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:onClick=\"withEditText\"\r\n        android:text=\"WITH EDIT TEXT\" \/&gt;\r\n\r\n\r\n&lt;\/LinearLayout&gt;\r\n<\/code><\/pre>\n<p>\u30dc\u30bf\u30f3\u3054\u3068\u306b\u3001\u95a2\u6570\u540d\u3092\u6307\u5b9a\u3057\u305fandroid:onClick\u5c5e\u6027\u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306eKotlin\u95a2\u6570\u306fMainActivity.kt\u30af\u30e9\u30b9\u3067\u30c8\u30ea\u30ac\u30fc\u3055\u308c\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u306e\u95a2\u6570\u306b\u3064\u3044\u3066\u9806\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h3>2. \u30b3\u30c8\u30ea\u30f3\u306e\u30e1\u30a4\u30f3\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u30b3\u30fc\u30c9<\/h3>\n<p>\u4e0a\u8a18\u306e\u6700\u521d\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u306f\u3059\u3067\u306b\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u305d\u308c\u3092\u4f7f\u3063\u3066\u3001MainActivity.kt\u306e\u5916\u89b3\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>package net.androidly.androidlyalertdialog\r\n\r\nimport android.content.DialogInterface\r\nimport android.support.v7.app.AppCompatActivity\r\nimport android.os.Bundle\r\nimport android.support.v7.app.AlertDialog\r\nimport android.view.View\r\nimport android.widget.Toast\r\n\r\nclass MainActivity : AppCompatActivity() {\r\n\r\n    val positiveButtonClick = { dialog: DialogInterface, which: Int -&gt;\r\n        Toast.makeText(applicationContext,\r\n                android.R.string.yes, Toast.LENGTH_SHORT).show()\r\n    }\r\n    val negativeButtonClick = { dialog: DialogInterface, which: Int -&gt;\r\n        Toast.makeText(applicationContext,\r\n                android.R.string.no, Toast.LENGTH_SHORT).show()\r\n    }\r\n    val neutralButtonClick = { dialog: DialogInterface, which: Int -&gt;\r\n        Toast.makeText(applicationContext,\r\n                \"Maybe\", Toast.LENGTH_SHORT).show()\r\n    }\r\n\r\n    override fun onCreate(savedInstanceState: Bundle?) {\r\n        super.onCreate(savedInstanceState)\r\n        setContentView(R.layout.activity_main)\r\n    }\r\n\r\n    fun basicAlert(view: View){\r\n\r\n        val builder = AlertDialog.Builder(this)\r\n\r\n        with(builder)\r\n        {\r\n            setTitle(\"Androidly Alert\")\r\n            setMessage(\"We have a message\")\r\n            setPositiveButton(\"OK\", DialogInterface.OnClickListener(function = positiveButtonClick))\r\n            setNegativeButton(android.R.string.no, negativeButtonClick)\r\n            setNeutralButton(\"Maybe\", neutralButtonClick)\r\n            show()\r\n        }\r\n\r\n\r\n    }\r\n}\r\n\r\n<\/code><\/pre>\n<h3>3. \u30a2\u30a4\u30b3\u30f3\u3068\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u53ef\u80fd\u306a\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0<\/h3>\n<pre class=\"post-pre\"><code>val builder = AlertDialog.Builder(this)\r\n        with(builder) {\r\n            setTitle(\"Icon and Button Color\")\r\n            setMessage(\"We have a message\")\r\n            setPositiveButton(\"OK\", null)\r\n            setNegativeButton(\"CANCEL\", null)\r\n            setNeutralButton(\"NEUTRAL\", null)\r\n            setPositiveButtonIcon(resources.getDrawable(android.R.drawable.ic_menu_call, theme))\r\n            setIcon(resources.getDrawable(android.R.drawable.ic_dialog_alert, theme))\r\n        }\r\n        val alertDialog = builder.create()\r\n        alertDialog.show()\r\n\r\n        val button = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE)\r\n        with(button) {\r\n            setBackgroundColor(Color.BLACK)\r\n            setPadding(0, 0, 20, 0)\r\n            setTextColor(Color.WHITE)\r\n        }\r\n<\/code><\/pre>\n<p>getButton\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u305d\u308c\u305e\u308c\u306e\u5b9a\u6570\u3092\u8a2d\u5b9a\u3057\u3066\u3001\u4efb\u610f\u306e\u30dc\u30bf\u30f3\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30dc\u30bf\u30f3\u3092\u53d6\u5f97\u3057\u305f\u5f8c\u306f\u3001\u4e0a\u8a18\u306e\u65b9\u6cd5\u3067\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>4. \u9805\u76ee\u4ed8\u304d\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0<\/h3>\n<pre class=\"post-pre\"><code>fun withItems(view: View) {\r\n\r\n        val items = arrayOf(\"Red\", \"Orange\", \"Yellow\", \"Blue\")\r\n        val builder = AlertDialog.Builder(this)\r\n        with(builder)\r\n        {\r\n            setTitle(\"List of Items\")\r\n            setItems(items) { dialog, which -&gt;\r\n                Toast.makeText(applicationContext, items[which] + \" is clicked\", Toast.LENGTH_SHORT).show()\r\n            }\r\n\r\n            setPositiveButton(\"OK\", positiveButtonClick)\r\n            show()\r\n        }\r\n    }\r\n<\/code><\/pre>\n<p>setItems\u5185\u3067\u3001\u79c1\u305f\u3061\u306fKotlin\u306e\u914d\u5217\u3092\u6e21\u3057\u307e\u3059\u3002which\u5f15\u6570\u306f\u3001\u30ea\u30b9\u30c8\u5185\u3067\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u8981\u7d20\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n<h3>5. \u30de\u30eb\u30c1\u30c1\u30e7\u30a4\u30b9\u30ea\u30b9\u30c8\u3092\u6301\u3064\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0<\/h3>\n<pre class=\"post-pre\"><code>fun withMultiChoiceList(view: View) {\r\n\r\n        val items = arrayOf(\"Microsoft\", \"Apple\", \"Amazon\", \"Google\")\r\n        val selectedList = ArrayList&lt;Int&gt;()\r\n        val builder = AlertDialog.Builder(this)\r\n\r\n        builder.setTitle(\"This is list choice dialog box\")\r\n        builder.setMultiChoiceItems(items, null\r\n        ) { dialog, which, isChecked -&gt;\r\n            if (isChecked) {\r\n                selectedList.add(which)\r\n            } else if (selectedList.contains(which)) {\r\n                selectedList.remove(Integer.valueOf(which))\r\n            }\r\n        }\r\n\r\n        builder.setPositiveButton(\"DONE\") { dialogInterface, i -&gt;\r\n            val selectedStrings = ArrayList&lt;string&gt;()\r\n\r\n            for (j in selectedList.indices) {\r\n                selectedStrings.add(items[selectedList[j]])\r\n            }\r\n\r\n            Toast.makeText(applicationContext, \"Items selected are: \" + Arrays.toString(selectedStrings.toTypedArray()), Toast.LENGTH_SHORT).show()\r\n        }\r\n\r\n        builder.show()\r\n\r\n    }\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u9078\u629e\u80a2\u3092\u6574\u6570\u306e\u914d\u5217\u30ea\u30b9\u30c8\u306b\u4fdd\u5b58\u3057\u3001\u518d\u3073\u53d6\u5f97\u3057\u3066Toast\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<h3>6. \u30b9\u30bf\u30a4\u30eb\u3092\u6301\u3064\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0<\/h3>\n<pre class=\"post-pre\"><code>fun withStyle(view: View) {\r\n\r\n        val builder = AlertDialog.Builder(ContextThemeWrapper(this, android.R.style.Holo_SegmentedButton))\r\n\r\n        with(builder)\r\n        {\r\n            setTitle(\"Androidly Alert\")\r\n            setMessage(\"We have a message\")\r\n            setPositiveButton(\"OK\", DialogInterface.OnClickListener(function = positiveButtonClick))\r\n            setNegativeButton(android.R.string.no, negativeButtonClick)\r\n            setNeutralButton(\"Maybe\", neutralButtonClick)\r\n            show()\r\n        }\r\n    }\r\n<\/code><\/pre>\n<p>ContextThemeWrapper\u3092\u4f7f\u7528\u3057\u306a\u3044\u5834\u5408\u3001Alert Dialog\u306f\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>7. \u30ab\u30b9\u30bf\u30e0\u30b9\u30bf\u30a4\u30eb\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0<\/h3>\n<p>styles.xml \u30d5\u30a1\u30a4\u30eb\u306b\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;style name=\"AlertDialogCustom\" parent=\"@android:style\/Theme.Material.Dialog\"&gt;\r\n        &lt;item name=\"android:textColor\"&gt;@android:color\/white&lt;\/item&gt;\r\n        &lt;item name=\"android:textStyle\"&gt;bold&lt;\/item&gt;\r\n        &lt;item name=\"android:headerDividersEnabled\"&gt;true&lt;\/item&gt;\r\n        &lt;item name=\"android:background\"&gt;@android:color\/holo_blue_dark&lt;\/item&gt;\r\n    &lt;\/style&gt;\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306fKotlin\u306e\u95a2\u6570\u3067\u3059\u3002 (I&#8217;ll provide one option)<\/p>\n<pre class=\"post-pre\"><code>fun withCustomStyle(view: View) {\r\n\r\n        val builder = AlertDialog.Builder(ContextThemeWrapper(this, R.style.AlertDialogCustom))\r\n\r\n        with(builder)\r\n        {\r\n            setTitle(\"Androidly Alert\")\r\n            setMessage(\"We have a message\")\r\n            setPositiveButton(\"OK\", DialogInterface.OnClickListener(function = positiveButtonClick))\r\n            setNegativeButton(android.R.string.no, negativeButtonClick)\r\n            setNeutralButton(\"Maybe\", neutralButtonClick)\r\n            show()\r\n        }\r\n\r\n    }\r\n<\/code><\/pre>\n<h3>8. \u30dc\u30bf\u30f3\u304c\u4e2d\u592e\u306b\u914d\u7f6e\u3055\u308c\u305f\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0<\/h3>\n<pre class=\"post-pre\"><code>fun withButtonCentered(view: View) {\r\n\r\n        val alertDialog = AlertDialog.Builder(this).create()\r\n        alertDialog.setTitle(\"Title\")\r\n        alertDialog.setMessage(\"Message\")\r\n\r\n        alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, \"Yes\"\r\n        ) { dialog, which -&gt; dialog.dismiss() }\r\n\r\n        alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, \"No\"\r\n        ) { dialog, which -&gt; dialog.dismiss() }\r\n        alertDialog.show()\r\n\r\n        val btnPositive = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE)\r\n        val btnNegative = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE)\r\n\r\n        val layoutParams = btnPositive.layoutParams as LinearLayout.LayoutParams\r\n        layoutParams.weight = 10f\r\n        btnPositive.layoutParams = layoutParams\r\n        btnNegative.layoutParams = layoutParams\r\n    }\r\n<\/code><\/pre>\n<h3>9. \u30a8\u30c7\u30a3\u30c3\u30c8\u30c6\u30ad\u30b9\u30c8\u3092\u542b\u3080\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0 (Edit Text\u3092\u542b\u3080\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0)<\/h3>\n<p>\u30ab\u30b9\u30bf\u30e0\u30ec\u30a4\u30a2\u30a6\u30c8alert_dialog_with_edittext.xml\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\uff1a<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:orientation=\"vertical\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"&gt;\r\n\r\n    &lt;EditText\r\n        android:id=\"@+id\/editText\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:hint=\"Enter the text here\"\/&gt;\r\n\r\n&lt;\/LinearLayout&gt;\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>fun withEditText(view: View) {\r\n        val builder = AlertDialog.Builder(this)\r\n        val inflater = layoutInflater\r\n        builder.setTitle(\"With EditText\")\r\n        val dialogLayout = inflater.inflate(R.layout.alert_dialog_with_edittext, null)\r\n        val editText  = dialogLayout.findViewById&lt;EditText&gt;(R.id.editText)\r\n        builder.setView(dialogLayout)\r\n        builder.setPositiveButton(\"OK\") { dialogInterface, i -&gt; Toast.makeText(applicationContext, \"EditText is \" + editText.text.toString(), Toast.LENGTH_SHORT).show() }\r\n        builder.show()\r\n    }\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/6564a67bdaa94e2bdf7c3fa4\/63-0.gif\" alt=\"android alert dialog demo output\" \/><\/div>\n<p>Android Studio\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\uff1aAndroidlyAlertDialog\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Alert Dialogs\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u3001Kotlin\u3092\u4f7f\u7528\u3057\u3066Android\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5b9f\u88c5\u3057\u307e\u3059\u3002 \u8b66\u544a\u30c0\u30a4\u30a2\u30ed\u30b0 \u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u306f\u753b\u9762\u4e0a\u306b\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3059\u308b\u30a6\u30a3\u30f3\u30c9\u30a6\u3067\u3059\u3002\u901a\u5e38\u3001\u60c5\u5831 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-931","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/kotlin\u3092\u4f7f\u7528\u3057\u305fandroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002\" \/>\n<meta property=\"og:description\" content=\"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/kotlin\u3092\u4f7f\u7528\u3057\u305fandroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-09T06:42:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T18:38:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/6564a67bdaa94e2bdf7c3fa4\/23-0.png\" \/>\n<meta name=\"author\" content=\"\u5149, \u660e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5149, \u660e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"31\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/\",\"name\":\"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-04-09T06:42:33+00:00\",\"dateModified\":\"2025-07-31T18:38:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55\"},\"description\":\"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55\",\"name\":\"\u5149, \u660e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g\",\"caption\":\"\u5149, \u660e\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/hikariakira\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002 - Blog - Silicon Cloud","description":"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/kotlin\u3092\u4f7f\u7528\u3057\u305fandroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002\/","og_locale":"ja_JP","og_type":"article","og_title":"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002","og_description":"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/kotlin\u3092\u4f7f\u7528\u3057\u305fandroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-09T06:42:33+00:00","article_modified_time":"2025-07-31T18:38:11+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/6564a67bdaa94e2bdf7c3fa4\/23-0.png"}],"author":"\u5149, \u660e","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u5149, \u660e","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"31\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/","name":"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-04-09T06:42:33+00:00","dateModified":"2025-07-31T18:38:11+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55"},"description":"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Kotlin\u3092\u4f7f\u7528\u3057\u305fAndroid\u306e\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3002"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55","name":"\u5149, \u660e","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g","caption":"\u5149, \u660e"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/hikariakira\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/kotlin%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9fandroid%e3%81%ae%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=931"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/931\/revisions"}],"predecessor-version":[{"id":46806,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/931\/revisions\/46806"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}