{"id":55255,"date":"2022-07-11T15:06:46","date_gmt":"2022-07-11T09:36:46","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=55255"},"modified":"2022-07-11T15:06:46","modified_gmt":"2022-07-11T09:36:46","slug":"android-katha-onactivityresult-is-deprecated-now-what","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/","title":{"rendered":"Android Katha: onActivityResult is Deprecated. Now What?"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-55254 aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/07\/1_5FIxi7ajt1OfL_FR5ODkWw-1-300x127.png\" alt=\"Blog image\" width=\"300\" height=\"127\" srcset=\"https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2022\/07\/1_5FIxi7ajt1OfL_FR5ODkWw-1-300x127.png 300w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2022\/07\/1_5FIxi7ajt1OfL_FR5ODkWw-1-768x325.png 768w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2022\/07\/1_5FIxi7ajt1OfL_FR5ODkWw-1-624x264.png 624w, https:\/\/www.tothenew.com\/blog\/wp-content\/uploads\/2022\/07\/1_5FIxi7ajt1OfL_FR5ODkWw-1.png 850w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p id=\"b6c4\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\">Hi and welcome to my blog,<\/p>\n<p id=\"f4e8\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\">During our Android application development, we have been using\u00a0<strong class=\"jp kj\">startActivityForResult<\/strong>\u00a0and\u00a0<strong class=\"jp kj\">onActivityResult<\/strong>\u00a0methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows.<\/p>\n<p id=\"4b7c\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\">Unfortunately, now we are getting a warning for this method in our code.<\/p>\n<p id=\"123a\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\">So the question is, Now What?<\/p>\n<p id=\"011b\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\">And the answer is:\u00a0<strong class=\"jp kj\">ActivityResultLauncher.<\/strong><\/p>\n<p id=\"14d7\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\"><strong class=\"jp kj\">Pros:<\/strong><\/p>\n<ol>\n<li id=\"480b\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\">We can now launch activities for the result from fragments and receive the results in fragments without going through the activity.<\/li>\n<li id=\"6f99\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\">Instead of distinguishing requests with fallible INT codes we now have strongly typed classes.<\/li>\n<li id=\"dff4\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\">We can have separate callbacks for separate requests, eliminating the need for switch-case in response handling.<\/li>\n<\/ol>\n<p id=\"fa48\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\"><strong class=\"jp kj\">onActivityResult(Kotlin)<\/strong>:<\/p>\n<blockquote>\n<pre class=\"jg jh ji jj ga kk bt kl\"><span id=\"6866\" class=\"gj ig ih ii km b do kn ko l kp\" data-selectable-paragraph=\"\">fun openSecondActivityForResult() {\r\n    val intent = Intent(this, SecondActivity::class.java)\r\n    startActivityForResult(intent, REQUEST_CODE)\r\n}\r\n\r\noverride fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {\r\n    super.onActivityResult(requestCode, resultCode, data)<\/span><span id=\"ec53\" class=\"gj ig ih ii km b do kq kr ks kt ku ko l kp\" data-selectable-paragraph=\"\">    \r\n    \r\n    if (resultCode == Activity.<em class=\"kv\">RESULT_OK <\/em>&amp;&amp; requestCode == REQUEST_CODE) {\r\n        \/\/ Do operations\r\n    }\r\n}\r\n\r\n<\/span><\/pre>\n<\/blockquote>\n<p id=\"fd0e\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\"><strong class=\"jp kj\">ActivityResultLauncher(Kotlin)<\/strong>:<\/p>\n<blockquote>\n<pre class=\"jg jh ji jj ga kk bt kl\"><span id=\"4bf5\" class=\"gj ig ih ii km b do kn ko l kp\" data-selectable-paragraph=\"\">fun openSecondActivityForResult() {\r\n    val intent = Intent(this, SecondActivity::class.java)\r\n    activityResultLauncher.launch(intent)\r\n}\r\n\r\n<\/span><span id=\"234c\" class=\"gj ig ih ii km b do kq kr ks kt ku ko l kp\" data-selectable-paragraph=\"\">\/\/ We can do the assignment inside onAttach or onCreate\r\nvar activityResultLauncher = registerForActivityResult(StartActivityForResult()) { result -&gt;\r\n    \/\/ There are no request codes\r\n\r\n<\/span><span id=\"0402\" class=\"gj ig ih ii km b do kq kr ks kt ku ko l kp\" data-selectable-paragraph=\"\">    if (result.resultCode == resultCode1 &amp;&amp; result.data != null) {\r\n        \/\/ Do operations\r\n    } else if (result.resultCode == resultCode2) {\r\n        \/\/ Do operations\r\n    }\r\n}<\/span><\/pre>\n<\/blockquote>\n<p id=\"1ec2\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" style=\"text-align: center;\" data-selectable-paragraph=\"\"><em class=\"kv\">\u2014 \u2014 \u2014 \u2014 \u2014 \u2014 \u2014 \u2014 How to replace existing calls\u2014 \u2014 \u2014 \u2014 \u2014 \u2014 \u2014 \u2014<\/em><\/p>\n<p id=\"979a\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\">Steps to replace old one with the new one (Kotlin):<\/p>\n<ol class=\"\">\n<li id=\"208a\" class=\"kw kx ii jp b jq jr ju jv is ky iw kz ja la kh lb lc ld le gj\" data-selectable-paragraph=\"\">In place of overridden method\u00a0<strong class=\"jp kj\">onActivityResult(\u2026)<\/strong>, use<\/li>\n<\/ol>\n<blockquote>\n<pre class=\"jg jh ji jj ga kk bt kl\"><span id=\"1d16\" class=\"gj ig ih ii km b do kn ko l kp\" data-selectable-paragraph=\"\">\/\/ We can do the assignment inside onAttach or onCreate\r\n<\/span><span id=\"3c48\" class=\"gj ig ih ii km b do kq kr ks kt ku ko l kp\" data-selectable-paragraph=\"\">var activityResultLauncher = registerForActivityResult(StartActivityForResult()) { result -&gt;\r\n    \/\/ There are no request codes    \r\n\r\n<\/span><span id=\"c6f2\" class=\"gj ig ih ii km b do kq kr ks kt ku ko l kp\" data-selectable-paragraph=\"\">    if (result.resultCode == resultCode1 &amp;&amp; result.data != null) {\r\n        \/\/ Do operations\r\n    } else if (result.resultCode == resultCode2) {\r\n        \/\/ Do operations\r\n    }\r\n}<\/span><\/pre>\n<\/blockquote>\n<p id=\"42e6\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\">\u00a0 \u00a0 \u00a02. In place of <strong class=\"jp kj\">startActivityForResult(intent, REQUEST_CODE)<\/strong>, use<\/p>\n<blockquote>\n<pre class=\"jg jh ji jj ga kk bt kl\"><span id=\"62c9\" class=\"gj ig ih ii km b do kn ko l kp\" data-selectable-paragraph=\"\">val intent: Intent = Intent(this, SecondActivity::class.<em class=\"kv\">java<\/em>) \r\nactivityResultLaunch.launch(intent)<\/span><\/pre>\n<\/blockquote>\n<p id=\"31af\" class=\"pw-post-body-paragraph jn jo ii jp b jq jr js jt ju jv jw jx is jy jz ka iw kb kc kd ja ke kf kg kh ib gj\" data-selectable-paragraph=\"\">\u00a0 \u00a0 \u00a03. In SecondActivity.java class, while returning back to the source activity, code will remain the same like &#8211;<\/p>\n<blockquote>\n<pre class=\"jg jh ji jj ga kk bt kl\"><span id=\"2786\" class=\"gj ig ih ii km b do kn ko l kp\" data-selectable-paragraph=\"\">val intent = Intent()\r\nsetResult(FirstActivity.resultCode1, intent)\r\nfinish()<\/span><\/pre>\n<\/blockquote>\n<blockquote class=\"lf lg lh\">\n<p data-selectable-paragraph=\"\">\n<\/blockquote>\n<p id=\"190a\" class=\"jn jo kv jp b jq jr js jt ju jv jw jx li jy jz ka lj kb kc kd lk ke kf kg kh ib gj\" data-selectable-paragraph=\"\">Please find the complete code with some demo screens on <a class=\"au ki\" href=\"https:\/\/github.com\/singh-sir\/android-katha\/tree\/onactivityresultblog\" target=\"_blank\" rel=\"noopener ugc nofollow\">GitHub<\/a><\/p>\n<p id=\"fec3\" class=\"jn jo kv jp b jq jr js jt ju jv jw jx li jy jz ka lj kb kc kd lk ke kf kg kh ib gj\" data-selectable-paragraph=\"\">Thanks for visiting, Keep reading &amp; keep improving \ud83d\ude42<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>&nbsp; Hi and welcome to my blog, During our Android application development, we have been using\u00a0startActivityForResult\u00a0and\u00a0onActivityResult\u00a0methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And [&hellip;]<\/p>\n","protected":false},"author":1476,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":324,"footnotes":""},"categories":[518],"tags":[4993],"class_list":["post-55255","post","type-post","status-publish","format-standard","hentry","category-android","tag-android-kotlin-java-deprecated-onactivityresult"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hi and welcome to my blog, During our Android application development, we have been using startActivityForResult and onActivityResult methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Kuldeep Singh\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Hi and welcome to my blog, During our Android application development, we have been using startActivityForResult and onActivityResult methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hi and welcome to my blog, During our Android application development, we have been using startActivityForResult and onActivityResult methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#article\",\"name\":\"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog\",\"headline\":\"Android Katha: onActivityResult is Deprecated. Now What?\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/kuldeep-singh\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2022\\\/07\\\/1_5FIxi7ajt1OfL_FR5ODkWw-1-300x127.png\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#articleImage\"},\"datePublished\":\"2022-07-11T15:06:46+05:30\",\"dateModified\":\"2022-07-11T15:06:46+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#webpage\"},\"articleSection\":\"Android, Android Kotlin Java Deprecated onActivityResult\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/android\\\/#listItem\",\"name\":\"Android\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/android\\\/#listItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/android\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#listItem\",\"name\":\"Android Katha: onActivityResult is Deprecated. Now What?\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#listItem\",\"position\":3,\"name\":\"Android Katha: onActivityResult is Deprecated. Now What?\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/android\\\/#listItem\",\"name\":\"Android\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/kuldeep-singh\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/kuldeep-singh\\\/\",\"name\":\"Kuldeep Singh\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/834a82c8-a753-43bd-86f7-3973480cc2eb_2943-Kuldeep-Singh-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Kuldeep Singh\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/\",\"name\":\"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog\",\"description\":\"Hi and welcome to my blog, During our Android application development, we have been using startActivityForResult and onActivityResult methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/android-katha-onactivityresult-is-deprecated-now-what\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/kuldeep-singh\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/kuldeep-singh\\\/#author\"},\"datePublished\":\"2022-07-11T15:06:46+05:30\",\"dateModified\":\"2022-07-11T15:06:46+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog","description":"Hi and welcome to my blog, During our Android application development, we have been using startActivityForResult and onActivityResult methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And","canonical_url":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#article","name":"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog","headline":"Android Katha: onActivityResult is Deprecated. Now What?","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/kuldeep-singh\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2022\/07\/1_5FIxi7ajt1OfL_FR5ODkWw-1-300x127.png","@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#articleImage"},"datePublished":"2022-07-11T15:06:46+05:30","dateModified":"2022-07-11T15:06:46+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#webpage"},"articleSection":"Android, Android Kotlin Java Deprecated onActivityResult"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/android\/#listItem","name":"Android"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/android\/#listItem","position":2,"name":"Android","item":"https:\/\/www.tothenew.com\/blog\/category\/android\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#listItem","name":"Android Katha: onActivityResult is Deprecated. Now What?"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#listItem","position":3,"name":"Android Katha: onActivityResult is Deprecated. Now What?","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/android\/#listItem","name":"Android"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/kuldeep-singh\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/kuldeep-singh\/","name":"Kuldeep Singh","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/834a82c8-a753-43bd-86f7-3973480cc2eb_2943-Kuldeep-Singh-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Kuldeep Singh"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/","name":"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog","description":"Hi and welcome to my blog, During our Android application development, we have been using startActivityForResult and onActivityResult methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/kuldeep-singh\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/kuldeep-singh\/#author"},"datePublished":"2022-07-11T15:06:46+05:30","dateModified":"2022-07-11T15:06:46+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog","og:description":"Hi and welcome to my blog, During our Android application development, we have been using startActivityForResult and onActivityResult methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And","og:url":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Android Katha: onActivityResult is Deprecated. Now What? | TO THE NEW Blog","twitter:description":"Hi and welcome to my blog, During our Android application development, we have been using startActivityForResult and onActivityResult methods a lot for the sake of callbacks from activities. It was really-clear and easy to implement. But Google knows. Unfortunately, now we are getting a warning for this method in our code. So the question is, Now What? And","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"55255","title":null,"description":null,"keywords":[],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":{"id":"#aioseo-article-65e04a7e4c246","slug":"article","graphName":"Article","label":"Article","properties":{"type":"BlogPosting","name":"#post_title","headline":"#post_title","description":"#post_excerpt","image":"","keywords":"","author":{"name":"#author_name","url":"#author_url"},"dates":{"include":true,"datePublished":"","dateModified":""}}},"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2022-07-11 09:36:16","updated":"2024-02-29 09:12:30","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/android\/\" title=\"Android\">Android<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tAndroid Katha: onActivityResult is Deprecated. Now What?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Android","link":"https:\/\/www.tothenew.com\/blog\/category\/android\/"},{"label":"Android Katha: onActivityResult is Deprecated. Now What?","link":"https:\/\/www.tothenew.com\/blog\/android-katha-onactivityresult-is-deprecated-now-what\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1476"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=55255"}],"version-history":[{"count":1,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55255\/revisions"}],"predecessor-version":[{"id":55256,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55255\/revisions\/55256"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=55255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=55255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=55255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}