{"id":1197,"date":"2019-01-10T17:10:07","date_gmt":"2019-01-10T16:10:07","guid":{"rendered":"https:\/\/zaven.co\/blog\/?p=1197"},"modified":"2025-04-08T19:55:07","modified_gmt":"2025-04-08T17:55:07","slug":"android-tutorial-starting-activity","status":"publish","type":"post","link":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/","title":{"rendered":"Android tutorial: starting another activity"},"content":{"rendered":"\n<p class=\"lead\">If you are an Android developer you may encounter a problem with app navigation during the app development process. In this Android tutorial I will describe a solution that makes code management much easier. Keep on reading and find out how to do it.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><span style=\"font-weight: 400;\">In the official <\/span><span style=\"font-weight: 400;\"><a href=\"https:\/\/developer.android.com\/training\/basics\/firstapp\/starting-activity#kotlin\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Android guide<\/a>,<\/span><span style=\"font-weight: 400;\"> we can read about how to program the display of another view in an application. However, this is a very simplified example that does not work well in complex applications. During my own work, I came up with a rather interesting solution, which greatly simplified code management. Keep on reading &#8220;<\/span><em>Android tutorial: starting another activity<\/em><span style=\"font-weight: 400;\"><em>&#8220;<\/em> to find out how to do it.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Starting another activity by Android Developers<\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Let&#8217;s assume that in <em>A<\/em><\/span><em><span style=\"font-weight: 400;\">ndroid application<\/span><\/em><span style=\"font-weight: 400;\"> we have created a list of projects from which we can access the details of a selected project. After selecting the element showing the list of projects, we go on to view its details. If we write this navigation in the same way as the guide shows it, it would look like the following example:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">const val EXTRA_PROJECT_ID = \"com.gratitude.ProjectId\"\nconst val EXTRA_PROJECT_NAME = \"com.gratitude.ProjectName\"\nconst val EXTRA_PROJECT_BACKGROUND_IMAGE_URL = \"com.gratitude.ProjectBackgroundImageUrl\"\n\nclass ProjectsActivity : AppCompatActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_projects)\n    }\n\n   fun showProjectDetails(project: Project) {\n        val intent = Intent(this, ProjectDetailsActivity::class.java).apply {\n            putExtra(EXTRA_PROJECT_ID, project.id)\n            putExtra(EXTRA_PROJECT_NAME, project.name)\n            putExtra(\n                EXTRA_PROJECT_BACKGROUND_IMAGE_URL,\n                project.backgroundImageUrl\n            )\n        }\n        startActivity(intent)\n    }\n}\n\noverride fun onCreate(savedInstanceState: Bundle?) {\n    super.onCreate(savedInstanceState)\n    setContentView(R.layout.activity_project_details)\n   \n    val id = intent.getStringExtra(EXTRA_PROJECT_ID)\n    val name = intent.getStringExtra(EXTRA_PROJECT_NAME)\n    val imageUrl = intent.getStringExtra(EXTRA_PROJECT_BACKGROUND_IMAGE_URL)\n    \n    val projectNameTextView = findViewById(R.id.projectNametextView)\n        .apply {\n            text = name\n        }\n}<\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">The guide has done its job. It shows navigation between activities in a way that is accessible to the reader. Problems may appear only after the application has grown.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Android app development: detected problems<\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" decoding=\"async\"   src=\"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_49607661_l-2015-730x730.jpg\" alt=\"Android tutorial\" class=\"wp-image-1213\" srcset=\"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_49607661_l-2015-730x730.jpg 730w, https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_49607661_l-2015-500x500.jpg 500w, https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_49607661_l-2015-1920x1920.jpg 1920w, https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_49607661_l-2015.jpg 2000w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure><\/div>\n\n\n\n<p><span style=\"font-weight: 400;\">When the application grows, it will be difficult to maintain such code. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">To start with, let&#8217;s define the main problems:<\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><b> Patchy data transfer between activities<\/b><\/li><li><b> Incomplete building of intentions and start-up activities<\/b><\/li><li><b> Inconsistent data collection from intentions<\/b><\/li><\/ol>\n\n\n\n<p>How can we improve the above approach?<\/p>\n\n\n\n<p>Let\u2019s ask some questions and try to find an answer to them:<\/p>\n\n\n\n<p><b>How can you unify data transfer between activities?<\/b><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"font-weight: 400;\">This problem can be fixed in many ways<\/span><\/li><li><span style=\"font-weight: 400;\">For each value we need to create a key, thanks to which, we will be able to receive a transferred value. Maintaining these keys is difficult<\/span><\/li><li><span style=\"font-weight: 400;\">We can save all transmitted values in a model, and add the instance of the model to a bundle of intentions, which will reduce the number of keys to one<\/span><\/li><\/ul>\n\n\n\n<p><b>How can we unify the method for creating intentions and starting activities?<\/b><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"font-weight: 400;\"> To start a different activity, we need to build an intention, which causes a duplication of code if it is written new every time<\/span><\/li><li><span style=\"font-weight: 400;\"> We can create a function that will build the intention and start the activity<\/span><\/li><\/ul>\n\n\n\n<p><b>How can we unify the method for receiving data from an intention?<\/b><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"font-weight: 400;\"> This code is often repeated, so you can improve its readability<\/span><\/li><li><span style=\"font-weight: 400;\">We can create a function that will receive data from an intention<\/span><span style=\"font-weight: 400;\"><br><\/span><\/li><\/ul>\n\n\n\n<p><span style=\"font-weight: 400;\"><b>In the following part of the<\/b> <\/span><span style=\"font-weight: 400;\">&#8220;<strong>Android<\/strong> <b>tutorial:<\/b> <strong>starting another activity<\/strong>&#8220;<\/span><span style=\"font-weight: 400;\">, let&#8217;s try to go through some solutions to the difficulties described above.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Android app development: the solutions<\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Incomplete data transfer between activities, building intentions and starting activities and receiving data from intentions. The following solutions show how you can deal with these problems during <em>A<\/em><\/span><em><span style=\"font-weight: 400;\">ndroid app development<\/span><span style=\"font-weight: 400;\">.<\/span><\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Android tutorial<\/b><b>: how to unify data transfer between activities?<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">To fix this problem, we will create a model that will store all the required data. In order the whole thing to make sense, it should be given a single form. That&#8217;s why I wrote the <code>NavigationBundle<\/code> base model.<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">@Parcelize\nopen class NavigationBundle(val uuid: UUID = UUID.randomUUID())\n    : Parcelable {\n    class Empty : NavigationBundle()\n}<\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">It is an open class, so we are able to inherit from it and use it in generic arguments. It contains its own identifier and is marked with the parcelize annotation. The parcelize annotation comes from <\/span><a href=\"https:\/\/kotlinlang.org\/docs\/tutorials\/android-plugin.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span style=\"font-weight: 400;\">Kotlin Android extensions<\/span><\/a><span style=\"font-weight: 400;\">. For a class with this annotation, an implementation of the <\/span><a href=\"https:\/\/developer.android.com\/reference\/android\/os\/Parcelable\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span style=\"font-weight: 400;\">parcelable<\/span><\/a><span style=\"font-weight: 400;\"> interface will be generated, thanks to which, we gain the ability to move data in intentions as parcelable using the <\/span><a href=\"https:\/\/developer.android.com\/reference\/android\/os\/Bundle.html%23putParcelable(java.lang.String,%2520android.os.Parcelable)\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span style=\"font-weight: 400;\">putParcelable<\/span><\/a><span style=\"font-weight: 400;\"> method.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The nested empty class will serve us as the default empty value of the <code>NavigationBundle<\/code>. An example of the <code>NavigationBundle<\/code>:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">class ProjectDetailsNavigationBundle(\n    val projectId: UUID,\n    val projectName: String,\n    val projectBackgroundImageUrl: String\n) : NavigationBundle()<\/code><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">For each activity, we write a class that contains all the necessary data (even if it is only one field).<\/span><code class=\"language-java\"><\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Android tutorial<\/b><b>: how can we unify the way of creating intentions and starting activities?&nbsp;<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Now we can go on to solve the next problem. We need to unify the method for creating intentions and starting activities. For that we&#8217;ll use <\/span><a href=\"https:\/\/kotlinlang.org\/docs\/reference\/lambdas.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span style=\"font-weight: 400;\">higher-order functions<\/span><\/a><span style=\"font-weight: 400;\"> and <\/span><a href=\"https:\/\/kotlinlang.org\/docs\/reference\/extensions.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span style=\"font-weight: 400;\">extension functions<\/span><\/a><span style=\"font-weight: 400;\">.&nbsp;<\/span><span style=\"font-weight: 400;\">Creating intentions:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">inline fun  FragmentActivity.createIntent(\n    bundle: NavigationBundle = NavigationBundle.Empty(),\n    crossinline block: Intent.() -&gt; Unit = {}\n): Intent {\n    val intent = Intent(this, T::class.java)\n    val extras = Bundle()\n    extras.putParcelable(KEY_NAVIGATION_BUNDLE, bundle)\n    intent.putExtras(extras)\n    return intent.apply(block)\n}<\/code><\/pre>\n\n\n\n<p>This function is an extension for the <code>FragmentActivity<\/code> class and accepts three parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The first is the generic type of activity to be started<\/li><li>The second is our previously described <code>NavigationBundle<\/code><\/li><li>The third parameter is lambda, which allows you to modify the creation of an object of intent<\/li><\/ul>\n\n\n\n<p>We are able to create intentions in a uniform way throughout the application.<\/p>\n\n\n\n<p>To solve our aforementioned problem, we need to write a function that will start an activity with a defined <code>NavigationBundle<\/code>.<\/p>\n\n\n\n<p>Which looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">inline fun  FragmentActivity.beginActivity(\n    bundle: NavigationBundle = NavigationBundle.Empty(),\n    crossinline block: Intent.() -&gt; Unit = {}\n) {\n    val intent = this.createIntent(bundle, block)\n    this.startActivity(intent)\n}<\/code><\/pre>\n\n\n\n<p>In its design, it closely resembles the <code>createIntent<\/code> function, since it takes the same parameters. The difference is that this time we use the <code>createIntent<\/code> function to create an intention, and then start the activity by calling the <code>startActivity method<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Android tutorial: how can we unify the method for receiving data from intention?<\/h3>\n\n\n\n<p>Our last problem is the unification of receiving data from intentions. You can do it in many ways, but we will again use extension functions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">inline fun  AppCompatActivity.getNavigationBundleOrNull(): T? {\n    return intent.extras?.getParcelable(KEY_NAVIGATION_BUNDLE)\n}<\/code><\/pre>\n\n\n\n<p>This function shortens the writing and improves its readability. We have solved the defined problem!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Starting another activity: revived<\/h2>\n\n\n\n<p>We already have all the necessary elements to our puzzle. So we can put them together to see the final result.<\/p>\n\n\n\n<p>Let\u2019s see if we can correct the example from the beginning of the article.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">class ProjectsActivity : AppCompatActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_projects)\n    }\n\n    \/** Called when the user taps the project item *\/\n   fun showProjectDetails(project: Project) {\n        val navigationBundle = ProjectDetailsNavigationBundle(\n            project.id,\n            project.name,\n            project.backgroundImageUrl\n        )\n        beginActivity(navigationBundle)\n    }\n}\n\noverride fun onCreate(savedInstanceState: Bundle?) {\n    super.onCreate(savedInstanceState)\n    setContentView(R.layout.activity_project_details)\n   \n    \/\/ Get the Intent that started this activity and extract the value\n    val navigationBundle =\n        getNavigationBundleOrNull()\n\n    \n    \/\/ Capture the layout's TextView and set the string as its text\n    val projectNameTextView = findViewById(R.id.projectNametextView)\n        .apply {\n            text = navigationBundle?.projectName\n        }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Android tutorial: starting another activity &#8211; summary<\/h2>\n\n\n\n<p>In the <em>Android tutorial<\/em>, we went through steps allowing for better management of both the code and the <em>Android app<\/em>. Thanks to this approach, we will not have problems with non-uniform transfer or reception of data between activities, even in an extended platform.<br>The methods used make our code clearer, we have reduced its repetition, and in a way our activities require us to run them in a defined method.<\/p>\n\n\n\n<p>How do you like the proposed solution? I encourage you to discuss in the comments below.<\/p>\n\n\n\n<p>For more interesting content follow our blog and another article about&nbsp;<a href=\"https:\/\/zaven.co\/blog\/opencv-android-studio-project\/\">Android&nbsp;development<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are an Android developer you may encounter a problem with app navigation during the app development process. In this Android tutorial I will describe a solution that makes code management much easier. Keep on reading and find out how to do it.<\/p>\n","protected":false},"author":11,"featured_media":1212,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56,5],"tags":[24,83,20,128,129,127,40,95,131,137],"class_list":["post-1197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-development","category-tutorials","tag-advanced-android-development","tag-android-app","tag-android-development","tag-android-tutorial","tag-app-development-for-android","tag-kotlin","tag-mobile-app","tag-process-of-mobile-app-development","tag-start-another-activity-in-android","tag-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Start another activity. Android tutorial | Zaven Blog<\/title>\n<meta name=\"description\" content=\"Detailed Android tutorial is a chance for you to get technical know-how about e.g. starting another activity in app. On Zaven blog, we share valuable tips.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Start another activity. Android tutorial | Zaven Blog\" \/>\n<meta property=\"og:description\" content=\"Detailed Android tutorial is a chance for you to get technical know-how about e.g. starting another activity in app. On Zaven blog, we share valuable tips.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/\" \/>\n<meta property=\"og:site_name\" content=\"Zaven Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-10T16:10:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-08T17:55:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_210627678_xl-2015-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"3000\" \/>\n\t<meta property=\"og:image:height\" content=\"1680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Slawomir Onyszko\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Slawomir Onyszko\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/\",\"url\":\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/\",\"name\":\"Start another activity. Android tutorial | Zaven Blog\",\"isPartOf\":{\"@id\":\"https:\/\/zaven.co\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_210627678_xl-2015-1.jpg\",\"datePublished\":\"2019-01-10T16:10:07+00:00\",\"dateModified\":\"2025-04-08T17:55:07+00:00\",\"author\":{\"@id\":\"https:\/\/zaven.co\/blog\/#\/schema\/person\/54027190fa6219030f9c4705fa7e0168\"},\"description\":\"Detailed Android tutorial is a chance for you to get technical know-how about e.g. starting another activity in app. On Zaven blog, we share valuable tips.\",\"breadcrumb\":{\"@id\":\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#primaryimage\",\"url\":\"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_210627678_xl-2015-1.jpg\",\"contentUrl\":\"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_210627678_xl-2015-1.jpg\",\"width\":3000,\"height\":1680,\"caption\":\"Android tutorial: starting another activity\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zaven.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android tutorial: starting another activity\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zaven.co\/blog\/#website\",\"url\":\"https:\/\/zaven.co\/blog\/\",\"name\":\"Zaven Blog\",\"description\":\"Software development blog. Generative AI, web &amp; mobile applications.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zaven.co\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zaven.co\/blog\/#\/schema\/person\/54027190fa6219030f9c4705fa7e0168\",\"name\":\"Slawomir Onyszko\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zaven.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4dc8884e2167c9cc97596c4b71c7c250?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4dc8884e2167c9cc97596c4b71c7c250?s=96&d=mm&r=g\",\"caption\":\"Slawomir Onyszko\"},\"description\":\"S\u0142awek is our mobile developer who mostly takes care of creating Android applications. He is constantly enhancing his skills of advanced Android app development and he wants to share this knowledge via Zaven\u2019s blog. In his spare time S\u0142awek enjoys watching a good movie at the cinema.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/mronyszko\"],\"url\":\"https:\/\/zaven.co\/blog\/author\/slawekzaven-pl\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Start another activity. Android tutorial | Zaven Blog","description":"Detailed Android tutorial is a chance for you to get technical know-how about e.g. starting another activity in app. On Zaven blog, we share valuable tips.","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:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/","og_locale":"en_US","og_type":"article","og_title":"Start another activity. Android tutorial | Zaven Blog","og_description":"Detailed Android tutorial is a chance for you to get technical know-how about e.g. starting another activity in app. On Zaven blog, we share valuable tips.","og_url":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/","og_site_name":"Zaven Blog","article_published_time":"2019-01-10T16:10:07+00:00","article_modified_time":"2025-04-08T17:55:07+00:00","og_image":[{"width":3000,"height":1680,"url":"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_210627678_xl-2015-1.jpg","type":"image\/jpeg"}],"author":"Slawomir Onyszko","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Slawomir Onyszko","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/","url":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/","name":"Start another activity. Android tutorial | Zaven Blog","isPartOf":{"@id":"https:\/\/zaven.co\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#primaryimage"},"image":{"@id":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#primaryimage"},"thumbnailUrl":"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_210627678_xl-2015-1.jpg","datePublished":"2019-01-10T16:10:07+00:00","dateModified":"2025-04-08T17:55:07+00:00","author":{"@id":"https:\/\/zaven.co\/blog\/#\/schema\/person\/54027190fa6219030f9c4705fa7e0168"},"description":"Detailed Android tutorial is a chance for you to get technical know-how about e.g. starting another activity in app. On Zaven blog, we share valuable tips.","breadcrumb":{"@id":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#primaryimage","url":"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_210627678_xl-2015-1.jpg","contentUrl":"https:\/\/zaven.co\/blog\/wp-content\/uploads\/2019\/01\/Depositphotos_210627678_xl-2015-1.jpg","width":3000,"height":1680,"caption":"Android tutorial: starting another activity"},{"@type":"BreadcrumbList","@id":"https:\/\/zaven.co\/blog\/android-tutorial-starting-activity\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zaven.co\/blog\/"},{"@type":"ListItem","position":2,"name":"Android tutorial: starting another activity"}]},{"@type":"WebSite","@id":"https:\/\/zaven.co\/blog\/#website","url":"https:\/\/zaven.co\/blog\/","name":"Zaven Blog","description":"Software development blog. Generative AI, web &amp; mobile applications.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zaven.co\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zaven.co\/blog\/#\/schema\/person\/54027190fa6219030f9c4705fa7e0168","name":"Slawomir Onyszko","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zaven.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4dc8884e2167c9cc97596c4b71c7c250?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4dc8884e2167c9cc97596c4b71c7c250?s=96&d=mm&r=g","caption":"Slawomir Onyszko"},"description":"S\u0142awek is our mobile developer who mostly takes care of creating Android applications. He is constantly enhancing his skills of advanced Android app development and he wants to share this knowledge via Zaven\u2019s blog. In his spare time S\u0142awek enjoys watching a good movie at the cinema.","sameAs":["https:\/\/www.linkedin.com\/in\/mronyszko"],"url":"https:\/\/zaven.co\/blog\/author\/slawekzaven-pl\/"}]}},"_links":{"self":[{"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/posts\/1197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/comments?post=1197"}],"version-history":[{"count":39,"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/posts\/1197\/revisions"}],"predecessor-version":[{"id":69944,"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/posts\/1197\/revisions\/69944"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/media\/1212"}],"wp:attachment":[{"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/media?parent=1197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/categories?post=1197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zaven.co\/blog\/wp-json\/wp\/v2\/tags?post=1197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}