In this video you will learn how to create and open new activity in Android Studio.
As a first step we will create a layout for our first initial activity. We just need one button. Let's call that button "Open Second Activity".
Now we want to create second activity. As a layout for second activity just place one TextView with a text: "This is second activtiy" or whatever you want.
When you are done with layout files go to your mainActivity class and declare Button variable. Set onClickListener for that button and put in openSecondActivity() function inside onClick(). Note that we haven't yet created this function(openSecondActivity).
Last step is to create openSecondActivity method. Inside this method just create Intent as shown in video and call startActivity() method, again, just like shown in video.
--------------
Make sure you subscribe for more tutorials :)
On this page of the site you can watch the video online Android Studio - Open New Activity Tutorial (2018) with a duration of hours minute second in good quality, which was uploaded by the user Programming Hustle 01 September 2018, share the link with friends and acquaintances, this video has already been watched 140 times on youtube and it was liked by 6 viewers. Enjoy your viewing!