{"id":1208,"date":"2025-05-06T09:48:22","date_gmt":"2025-05-06T00:48:22","guid":{"rendered":"https:\/\/itstudy365.com\/blog\/?p=1208"},"modified":"2025-05-24T09:36:40","modified_gmt":"2025-05-24T00:36:40","slug":"intent%e3%81%a8%e7%94%bb%e9%9d%a2%e9%81%b7%e7%a7%bb%e3%81%ae%e5%9f%ba%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/itstudy365.com\/blog\/2025\/05\/06\/intent%e3%81%a8%e7%94%bb%e9%9d%a2%e9%81%b7%e7%a7%bb%e3%81%ae%e5%9f%ba%e6%9c%ac\/","title":{"rendered":"Android application development \u7b2c5\u7ae0\uff1aIntent\u3068\u753b\u9762\u9077\u79fb\u306e\u57fa\u672c"},"content":{"rendered":"\n<button id=\"bb1\" type=\"button\" value=\"Play\" class=\"responsivevoice-button\" title=\"ResponsiveVoice Tap to Start\/Stop Speech\"><span>&#128266; Play<\/span><\/button>\n        <script>\n            bb1.onclick = function(){\n                if(responsiveVoice.isPlaying()){\n                    responsiveVoice.cancel();\n                }else{\n                    responsiveVoice.speak(\"Android\u3067\u306f\u3001\u753b\u9762\uff08Activity\uff09\u540c\u58eb\u3092\u79fb\u52d5\u3059\u308b\u624b\u6bb5\u3068\u3057\u3066 Intent\uff08\u30a4\u30f3\u30c6\u30f3\u30c8\uff09 \u3068\u3044\u3046\u4ed5\u7d44\u307f\u304c\u4f7f\u308f\u308c\u307e\u3059\u3002 Java\u3067\u4f8b\u3048\u308b\u306a\u3089\u3001\u300c\u5225\u306e\u30af\u30e9\u30b9\u306e\u51e6\u7406\u3092\u547c\u3073\u51fa\u3057\u305f\u3044\u300d\u3068\u304d\u306b new \u3084 \u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057 \u3092\u4f7f\u3046\u306e\u306b\u4f3c\u3066\u3044\u307e\u3059\u3002\u3067\u3059\u304c\u3001Android\u3067\u306f\u30e6\u30fc\u30b6\u30fc\u64cd\u4f5c\u3084\u30b7\u30b9\u30c6\u30e0\u9023\u643a\u3082\u95a2\u308f\u308b\u305f\u3081\u3001Intent \u3068\u3044\u3046\u201c\u30e1\u30c3\u30bb\u30fc\u30b8\u201d\u3067\u79fb\u52d5\u6307\u793a\u3092\u51fa\u3059\u3068\u3044\u3046\u8003\u3048\u65b9\u306b\u306a\u308a\u307e\u3059\u3002 \u25a0 Intent\u3068\u306f\uff1f Intent \u306f\u3001\u300c\uff5e\u3092\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u201c\u610f\u56f3\u201d\u3092\u8868\u73fe\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002\u4e3b\u306b\u4ee5\u4e0b\u306e2\u3064\u306e\u4f7f\u3044\u65b9\u304c\u3042\u308a\u307e\u3059\uff1a \u7528\u9014\u5185\u5bb9\u4f8b\u660e\u793a\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\u7279\u5b9a\u306eActivity\u3092\u8d77\u52d5\u3059\u308b\u753b\u9762\u9077\u79fb\u306a\u3069\u6697\u9ed9\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\u7279\u5b9a\u306e\u6a5f\u80fd\u3092\u6301\u3064\u30a2\u30d7\u30ea\u306b\u51e6\u7406\u3092\u59d4\u306d\u308b\u30ab\u30e1\u30e9\u3092\u8d77\u52d5\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u306a\u3069 \u25a0 \u753b\u9762\u9077\u79fb\uff08\u660e\u793a\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\uff09\u306e\u57fa\u672c\u30b3\u30fc\u30c9 \u305f\u3068\u3048\u3070\u3001MainActivity \u304b\u3089 SecondActivity \u306b\u9077\u79fb\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a Intent intent = new Intent(MainActivity.this, SecondActivity.class); startActivity(intent); \u30dd\u30a4\u30f3\u30c8\uff1a Intent \u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306e\u7b2c1\u5f15\u6570\u306f\u300c\u4eca\u306eActivity\u306eContext\u300d\u3002 \u7b2c2\u5f15\u6570\u306f\u300c\u9077\u79fb\u5148\u306eActivity\u30af\u30e9\u30b9\u300d\u3002 startActivity() \u3067\u753b\u9762\u9077\u79fb\u304c\u884c\u308f\u308c\u307e\u3059\u3002 \u25a0 \u30c7\u30fc\u30bf\u3092\u6e21\u3059\u5834\u5408 \u5225\u306eActivity\u306b\u5024\u3092\u6e21\u3057\u305f\u3044\u3068\u304d\u306f\u3001putExtra() \u3092\u4f7f\u3044\u307e\u3059\u3002 Intent intent = new Intent(MainActivity.this, SecondActivity.class); intent.putExtra(\\\"USERNAME\\\", \\\"taro\\\"); startActivity(intent); SecondActivity \u5074\u3067\u53d7\u3051\u53d6\u308b\u306b\u306f\uff1a String username = getIntent().getStringExtra(\\\"USERNAME\\\"); \u3053\u308c\u306fJava\u306e\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u306e\u5f15\u6570\u306b\u8fd1\u3044\u611f\u899a\u3067\u3059\u3002 \u25a0 \u753b\u9762\u304b\u3089\u623b\u3063\u3066\u5024\u3092\u53d7\u3051\u53d6\u308a\u305f\u3044\u5834\u5408\uff08startActivityForResult\uff09 startActivityForResult() \u306f\u975e\u63a8\u5968\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u73fe\u5728\u306f Activity Result API \u3092\u4f7f\u3046\u306e\u304c\u4e3b\u6d41\u3067\u3059\u3002 \u25a0 \u6697\u9ed9\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\u306e\u4f8b \u305f\u3068\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u753b\u50cf\u3092\u5171\u6709\u3057\u305f\u3044\u5834\u5408\uff1a Intent intent = new Intent(Intent.ACTION_SEND); intent.setType(\\\"text\/plain\\\"); intent.putExtra(Intent.EXTRA_TEXT, \\\"\u3053\u3093\u306b\u3061\u306f\uff01\\\"); startActivity(Intent.createChooser(intent, \\\"\u5171\u6709\u65b9\u6cd5\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\\\")); \u3053\u308c\u306f\u300c\u3053\u306e\u30c7\u30fc\u30bf\u3092\u9001\u308b\u51e6\u7406\u304c\u3067\u304d\u308b\u30a2\u30d7\u30ea\u3092Android\u306b\u63a2\u3057\u3066\u3082\u3089\u3046\u300d\u3068\u3044\u3046\u3084\u308a\u65b9\u3067\u3059\u3002 \u25a0 Manifest\u3067\u306e\u5ba3\u8a00 \u9077\u79fb\u5148\u306e SecondActivity \u306f\u3001AndroidManifest.xml \u306b\u5fc5\u305a\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\uff1a less thanactivity android:name=\\\".SecondActivity\\\" \/greater than \u307e\u3068\u3081\uff1aIntent\u306fAndroid\u306b\u304a\u3051\u308b\u300c\u4f9d\u983c\u66f8\u300d Intent\u306f\u3001\u5358\u306b\u753b\u9762\u3092\u5207\u308a\u66ff\u3048\u308b\u305f\u3081\u3060\u3051\u3067\u306a\u304f\u3001\u51e6\u7406\u306e\u59d4\u8b72\u30fb\u4ed6\u30a2\u30d7\u30ea\u3068\u306e\u9023\u643a\u30fb\u30e6\u30fc\u30b6\u30fc\u64cd\u4f5c\u306b\u5fdc\u3058\u305f\u52d5\u7684\u306a\u30a2\u30af\u30b7\u30e7\u30f3\u306a\u3069\u3001\u975e\u5e38\u306b\u591a\u304f\u306e\u6a5f\u80fd\u306e\u6838\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u753b\u9762\u9077\u79fb\u306f\u3001Android\u958b\u767a\u306e\u7b2c\u4e00\u6b69\u3002\u307e\u305a\u306f\u660e\u793a\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\u3067\u8907\u6570\u306e\u753b\u9762\u3092\u3064\u306a\u3052\u3066\u307f\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u3089\u3057\u3044\u4f53\u9a13\u304c\u4f5c\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\", \"Japanese Female\");\n                }\n            };\n        <\/script>\n    <\/p>\n\n\n\n<p>Android\u3067\u306f\u3001<strong>\u753b\u9762\uff08Activity\uff09\u540c\u58eb\u3092\u79fb\u52d5\u3059\u308b\u624b\u6bb5<\/strong>\u3068\u3057\u3066 <code>Intent\uff08\u30a4\u30f3\u30c6\u30f3\u30c8\uff09<\/code> \u3068\u3044\u3046\u4ed5\u7d44\u307f\u304c\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>Java\u3067\u4f8b\u3048\u308b\u306a\u3089\u3001\u300c\u5225\u306e\u30af\u30e9\u30b9\u306e\u51e6\u7406\u3092\u547c\u3073\u51fa\u3057\u305f\u3044\u300d\u3068\u304d\u306b <code>new<\/code> \u3084 <code>\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057<\/code> \u3092\u4f7f\u3046\u306e\u306b\u4f3c\u3066\u3044\u307e\u3059\u3002\u3067\u3059\u304c\u3001Android\u3067\u306f\u30e6\u30fc\u30b6\u30fc\u64cd\u4f5c\u3084\u30b7\u30b9\u30c6\u30e0\u9023\u643a\u3082\u95a2\u308f\u308b\u305f\u3081\u3001<strong>Intent \u3068\u3044\u3046\u201c\u30e1\u30c3\u30bb\u30fc\u30b8\u201d\u3067\u79fb\u52d5\u6307\u793a\u3092\u51fa\u3059<\/strong>\u3068\u3044\u3046\u8003\u3048\u65b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u25a0 Intent\u3068\u306f\uff1f<\/h3>\n\n\n\n<p><code>Intent<\/code> \u306f\u3001<strong>\u300c\uff5e\u3092\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u201c\u610f\u56f3\u201d\u3092\u8868\u73fe\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3067\u3059\u3002\u4e3b\u306b\u4ee5\u4e0b\u306e2\u3064\u306e\u4f7f\u3044\u65b9\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u7528\u9014<\/th><th>\u5185\u5bb9<\/th><th>\u4f8b<\/th><\/tr><\/thead><tbody><tr><td>\u660e\u793a\u7684\u30a4\u30f3\u30c6\u30f3\u30c8<\/td><td>\u7279\u5b9a\u306eActivity\u3092\u8d77\u52d5\u3059\u308b<\/td><td>\u753b\u9762\u9077\u79fb\u306a\u3069<\/td><\/tr><tr><td>\u6697\u9ed9\u7684\u30a4\u30f3\u30c6\u30f3\u30c8<\/td><td>\u7279\u5b9a\u306e\u6a5f\u80fd\u3092\u6301\u3064\u30a2\u30d7\u30ea\u306b\u51e6\u7406\u3092\u59d4\u306d\u308b<\/td><td>\u30ab\u30e1\u30e9\u3092\u8d77\u52d5\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u306a\u3069<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u25a0 \u753b\u9762\u9077\u79fb\uff08\u660e\u793a\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\uff09\u306e\u57fa\u672c\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<p>\u305f\u3068\u3048\u3070\u3001<code>MainActivity<\/code> \u304b\u3089 <code>SecondActivity<\/code> \u306b\u9077\u79fb\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>Intent intent = new Intent(MainActivity.this, SecondActivity.class);\nstartActivity(intent);<\/code><\/pre><\/div>\n\n\n\n<p>\u30dd\u30a4\u30f3\u30c8\uff1a<\/p>\n\n\n\n<ul>\n<li><code>Intent<\/code> \u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306e\u7b2c1\u5f15\u6570\u306f\u300c\u4eca\u306eActivity\u306eContext\u300d\u3002<\/li>\n\n\n\n<li>\u7b2c2\u5f15\u6570\u306f\u300c\u9077\u79fb\u5148\u306eActivity\u30af\u30e9\u30b9\u300d\u3002<\/li>\n\n\n\n<li><code>startActivity()<\/code> \u3067\u753b\u9762\u9077\u79fb\u304c\u884c\u308f\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u25a0 \u30c7\u30fc\u30bf\u3092\u6e21\u3059\u5834\u5408<\/h3>\n\n\n\n<p>\u5225\u306eActivity\u306b\u5024\u3092\u6e21\u3057\u305f\u3044\u3068\u304d\u306f\u3001<code>putExtra()<\/code> \u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>Intent intent = new Intent(MainActivity.this, SecondActivity.class);\nintent.putExtra(&quot;USERNAME&quot;, &quot;taro&quot;);\nstartActivity(intent);<\/code><\/pre><\/div>\n\n\n\n<p><code>SecondActivity<\/code> \u5074\u3067\u53d7\u3051\u53d6\u308b\u306b\u306f\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>String username = getIntent().getStringExtra(&quot;USERNAME&quot;);<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u308c\u306fJava\u306e\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u306e\u5f15\u6570\u306b\u8fd1\u3044\u611f\u899a\u3067\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u25a0 \u753b\u9762\u304b\u3089\u623b\u3063\u3066\u5024\u3092\u53d7\u3051\u53d6\u308a\u305f\u3044\u5834\u5408\uff08startActivityForResult\uff09<\/h3>\n\n\n\n<p><code>startActivityForResult()<\/code> \u306f\u975e\u63a8\u5968\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u73fe\u5728\u306f <strong>Activity Result API<\/strong> \u3092\u4f7f\u3046\u306e\u304c\u4e3b\u6d41\u3067\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u25a0 \u6697\u9ed9\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\u306e\u4f8b<\/h3>\n\n\n\n<p>\u305f\u3068\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u753b\u50cf\u3092\u5171\u6709\u3057\u305f\u3044\u5834\u5408\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>Intent intent = new Intent(Intent.ACTION_SEND);\nintent.setType(&quot;text\/plain&quot;);\nintent.putExtra(Intent.EXTRA_TEXT, &quot;\u3053\u3093\u306b\u3061\u306f\uff01&quot;);\nstartActivity(Intent.createChooser(intent, &quot;\u5171\u6709\u65b9\u6cd5\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044&quot;));<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u308c\u306f\u300c\u3053\u306e\u30c7\u30fc\u30bf\u3092\u9001\u308b\u51e6\u7406\u304c\u3067\u304d\u308b\u30a2\u30d7\u30ea\u3092Android\u306b\u63a2\u3057\u3066\u3082\u3089\u3046\u300d\u3068\u3044\u3046\u3084\u308a\u65b9\u3067\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u25a0 Manifest\u3067\u306e\u5ba3\u8a00<\/h3>\n\n\n\n<p>\u9077\u79fb\u5148\u306e <code>SecondActivity<\/code> \u306f\u3001AndroidManifest.xml \u306b\u5fc5\u305a\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>&lt;activity android:name=&quot;.SecondActivity&quot; \/&gt;<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081\uff1aIntent\u306fAndroid\u306b\u304a\u3051\u308b\u300c\u4f9d\u983c\u66f8\u300d<\/h2>\n\n\n\n<p>Intent\u306f\u3001\u5358\u306b\u753b\u9762\u3092\u5207\u308a\u66ff\u3048\u308b\u305f\u3081\u3060\u3051\u3067\u306a\u304f\u3001<strong>\u51e6\u7406\u306e\u59d4\u8b72\u30fb\u4ed6\u30a2\u30d7\u30ea\u3068\u306e\u9023\u643a\u30fb\u30e6\u30fc\u30b6\u30fc\u64cd\u4f5c\u306b\u5fdc\u3058\u305f\u52d5\u7684\u306a\u30a2\u30af\u30b7\u30e7\u30f3<\/strong>\u306a\u3069\u3001\u975e\u5e38\u306b\u591a\u304f\u306e\u6a5f\u80fd\u306e\u6838\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u753b\u9762\u9077\u79fb\u306f\u3001Android\u958b\u767a\u306e\u7b2c\u4e00\u6b69\u3002\u307e\u305a\u306f\u660e\u793a\u7684\u30a4\u30f3\u30c6\u30f3\u30c8\u3067\u8907\u6570\u306e\u753b\u9762\u3092\u3064\u306a\u3052\u3066\u307f\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u3089\u3057\u3044\u4f53\u9a13\u304c\u4f5c\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[54],"_links":{"self":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1208"}],"collection":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/comments?post=1208"}],"version-history":[{"count":3,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1208\/revisions"}],"predecessor-version":[{"id":1336,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1208\/revisions\/1336"}],"wp:attachment":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/media?parent=1208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/categories?post=1208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/tags?post=1208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}