{"id":1903,"date":"2018-04-11T13:19:25","date_gmt":"2018-04-11T04:19:25","guid":{"rendered":"http:\/\/kuuur.net\/?p=1903"},"modified":"2018-04-11T13:19:25","modified_gmt":"2018-04-11T04:19:25","slug":"listview","status":"publish","type":"post","link":"https:\/\/kuuur.net\/?p=1903","title":{"rendered":"Android\u30a2\u30d7\u30ea\uff1a\u30c6\u30ad\u30b9\u30c8\u3092\u30ea\u30b9\u30c8\u8868\u793a\u3059\u308b"},"content":{"rendered":"<p>Android\u30a2\u30d7\u30ea\u3067\u3001ListView\u3092\u4f7f\u3044\u3001\u914d\u5217\u306b\u683c\u7d0d\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u3092\u30ea\u30b9\u30c8\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<h2>MainActivity.java<\/h2>\n<div class=\"source\">\n<pre>import android.app.Activity;\r\nimport android.os.Bundle;\r\nimport android.widget.ArrayAdapter;\r\nimport android.widget.ListView;\r\n\r\npublic class MainActivity extends Activity {\r\n\r\n    private static final String listword[][] = {\r\n            {\r\n                    \"1\u756a\u76ee\u306e\u30ea\u30b9\u30c81\",\r\n                    \"1\u756a\u76ee\u306e\u30ea\u30b9\u30c82\"\r\n            },\r\n            {\r\n                    \"2\u756a\u76ee\u306e\u30ea\u30b9\u30c81\",\r\n                    \"2\u756a\u76ee\u306e\u30ea\u30b9\u30c82\",\r\n                    \"2\u756a\u76ee\u306e\u30ea\u30b9\u30c83\"\r\n            }\r\n\r\n    };\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n\r\n        ListView listView = findViewById(R.id.list_view);\r\n        ArrayAdapter&lt;String&gt; arrayAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,listword[0]);\r\n        listView.setAdapter(arrayAdapter);\r\n    }\r\n}<\/pre>\n<\/div>\n<h2>activity_main.xml<\/h2>\n<div class=\"source\">\n<pre>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;RelativeLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n\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    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;ListView\r\n        android:id=\"@+id\/list_view\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\" \/&gt;\r\n\r\n&lt;\/RelativeLayout&gt;<\/pre>\n<\/div>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u30012\u6b21\u5143\u914d\u5217\u306b\u30c6\u30ad\u30b9\u30c8\u3092\u5165\u308c\u305f\u5834\u5408\u3067\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<br \/>\nlistword[0]\u3067\u3001\u6700\u521d\u306e\u914d\u5217\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3053\u3092listword[1]\u306b\u3059\u308c\u3070\u30012\u756a\u76ee\u306e\u914d\u5217\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1905\" src=\"https:\/\/kuuur.net\/wp-content\/uploads\/2018\/04\/2018-04-11-13_18_33-Android-Emulator-Nexus_5X_API_24_5554.png\" alt=\"\" width=\"459\" height=\"820\" srcset=\"https:\/\/kuuur.net\/wp-content\/uploads\/2018\/04\/2018-04-11-13_18_33-Android-Emulator-Nexus_5X_API_24_5554.png 459w, https:\/\/kuuur.net\/wp-content\/uploads\/2018\/04\/2018-04-11-13_18_33-Android-Emulator-Nexus_5X_API_24_5554-168x300.png 168w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android\u30a2\u30d7\u30ea\u3067\u3001ListView\u3092\u4f7f\u3044\u3001\u914d\u5217\u306b\u683c\u7d0d\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u3092\u30ea\u30b9\u30c8\u8868\u793a\u3057\u307e\u3059\u3002 MainActivity.java import android.app.Activity; import &#8230;<span class=\"continue\"><a href=\"https:\/\/kuuur.net\/?p=1903\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-1903","post","type-post","status-publish","format-standard","hentry","category-android"],"views":5086,"_links":{"self":[{"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/posts\/1903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kuuur.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1903"}],"version-history":[{"count":2,"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/posts\/1903\/revisions"}],"predecessor-version":[{"id":1906,"href":"https:\/\/kuuur.net\/index.php?rest_route=\/wp\/v2\/posts\/1903\/revisions\/1906"}],"wp:attachment":[{"href":"https:\/\/kuuur.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kuuur.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kuuur.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}