{"id":10632,"date":"2020-11-21T10:38:13","date_gmt":"2020-11-21T01:38:13","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=10632"},"modified":"2020-11-21T15:53:17","modified_gmt":"2020-11-21T06:53:17","slug":"android-activity-%ed%98%b8%ec%b6%9c%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=10632","title":{"rendered":"[Android] Activity \ud638\ucd9c\ud558\uae30"},"content":{"rendered":"<p>Activity\ub97c \ud638\ucd9c\ud558\ub294 \ucf54\ub4dc\ub97c \uc815\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n<p>\uba3c\uc800 Activity\ub97c \ud558\ub098 \ub9cc\ub4ed\ub2c8\ub2e4. \uc774 \ub140\uc11d \uc774\ub984\uc774 DataCollectingListActivity\ub77c\uace0 \ud558\uaca0\uc2b5\ub2c8\ub2e4. \uc774 \uc5d1\ud2f0\ube44\ud2b8\ub97c \ud638\ucd9c\ud558\ub294 \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. \uc804\ub2ec\ud574\uc904 \uc778\uc790\ub294 Intent\uc5d0 \uc804\ub2ec\ud574 \uc90d\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\nval intent = Intent(this, DataCollectingListActivity::class.java)\r\nintent.putExtra(\"featureId\", fid);\r\nstartActivityForResult(intent, REQUEST_DATA_COLLECTION_LIST)\r\n<\/pre>\n<p>REQUEST_DATA_COLLECTION_LIST\ub294 \uc5d1\ud2f0\ube44\ud2f0\ub97c \ub744\uc6b0\uace0 \ub2eb\uc744\ub54c \ud574\ub2f9 \uc5d1\ud2f0\ube44\ub97c \uad6c\ubd84\ud558\uae30 \uc704\ud55c \uc0c1\uc218\uac12\uc778\ub370\uc694, \uc544\ub798\ucc98\ub7fc \uc120\uc5b8\ud569\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\nprivate val REQUEST_DATA_COLLECTION_LIST = 100\r\n<\/pre>\n<p>\ub2e4\uc74c\uc740 DataCollectingListActivity\uc5d0\uc11c \uc804\ub2ec\ubc1b\uc740 \uc778\uc790\ub97c \ucc98\ub9ac\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\noverride fun onCreate(savedInstanceState: Bundle?) {\r\n    super.onCreate(savedInstanceState)\r\n    setContentView(R.layout.data_collecting_list_activity)\r\n\r\n    val fid = this.intent.getIntExtra(\"featureId\", -1)\r\n    Log.v(\"DIP2K\", \"\ubc1b\uc740 FID: $fid\")\r\n\r\n    ....\r\n}\r\n<\/pre>\n<p>\uc5d1\ud2f0\ube44\ud2f0\ub97c \ub2eb\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ub2eb\uc744\ub54c \uc790\uc2e0\uc744 \ud638\ucd9c\ud55c \uc5d1\ud2f0\ube44\ud2f0\uc5d0 \uacb0\uacfc\ub97c \uc804\ub2ec\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\nval intent = Intent()\r\nintent.putExtra(\"data\", \"\uc804\ub2ec\ud560 \ub370\uc774\ud130\")\r\nsetResult(RESULT_OK, intent)\r\nfinish()\r\n<\/pre>\n<p>setResult \ud568\uc218\ub97c \ud1b5\ud574 \ub300\ud654\uc0c1\uc790\uc758 \uac1c\ub150\uc73c\ub85c \uc0ac\uc6a9\uc790\uc5d0\uac8c \ud655\uc778(RESULT_OK)\uc778\uc9c0, \ucde8\uc18c(RESULT_CANCEL)\uc778\uc9c0\uc5d0 \ub300\ud55c \uc758\uc0ac\uc804\ub2ec\uc774 \uac00\ub2a5\ud569\ub2c8\ub2e4.<\/p>\n<p>\ub744\uc6b4 \uc5d1\ud2f0\ube44\ud2f0\uac00 \uacb0\uacfc\uac12\uc73c\ub85c \uc804\ub2ec\ud55c \ub0b4\uc6a9\uc744 \uc77d\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\noverride fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {\r\n    super.onActivityResult(requestCode, resultCode, data)\r\n\r\n    if (resultCode == RESULT_OK) {\r\n        when (requestCode) {\r\n            REQUEST_DATA_COLLECTION_LIST -> {\r\n                Log.v(\"DIP2K\", data!!.getStringExtra(\"data\")!!)\r\n            }\r\n        }\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Activity\ub97c \ud638\ucd9c\ud558\ub294 \ucf54\ub4dc\ub97c \uc815\ub9ac\ud569\ub2c8\ub2e4. \uba3c\uc800 Activity\ub97c \ud558\ub098 \ub9cc\ub4ed\ub2c8\ub2e4. \uc774 \ub140\uc11d \uc774\ub984\uc774 DataCollectingListActivity\ub77c\uace0 \ud558\uaca0\uc2b5\ub2c8\ub2e4. \uc774 \uc5d1\ud2f0\ube44\ud2b8\ub97c \ud638\ucd9c\ud558\ub294 \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. \uc804\ub2ec\ud574\uc904 \uc778\uc790\ub294 Intent\uc5d0 \uc804\ub2ec\ud574 \uc90d\ub2c8\ub2e4. val intent = Intent(this, DataCollectingListActivity::class.java) intent.putExtra(&#8220;featureId&#8221;, fid); startActivityForResult(intent, REQUEST_DATA_COLLECTION_LIST) REQUEST_DATA_COLLECTION_LIST\ub294 \uc5d1\ud2f0\ube44\ud2f0\ub97c \ub744\uc6b0\uace0 \ub2eb\uc744\ub54c \ud574\ub2f9 \uc5d1\ud2f0\ube44\ub97c \uad6c\ubd84\ud558\uae30 \uc704\ud55c \uc0c1\uc218\uac12\uc778\ub370\uc694, \uc544\ub798\ucc98\ub7fc \uc120\uc5b8\ud569\ub2c8\ub2e4. private val REQUEST_DATA_COLLECTION_LIST = 100 \ub2e4\uc74c\uc740 DataCollectingListActivity\uc5d0\uc11c \uc804\ub2ec\ubc1b\uc740 \uc778\uc790\ub97c \ucc98\ub9ac\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=10632\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[Android] Activity \ud638\ucd9c\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-10632","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10632"}],"version-history":[{"count":5,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10632\/revisions"}],"predecessor-version":[{"id":10654,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10632\/revisions\/10654"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10632"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}