‫Welcome back.
‫We learned how to transition from the first activity to the second activity using the explicit intents.
‫In this video, we're going to pass data between different activities.
‫In Android.
‫We can use the method called Put Extra that it's a part of intent class to attach additional information
‫extras to the intent.
‫Let's start using this explicit intent object that we created before dot.
‫Put extra.
‫This is a method provided by the intent class in Android, and it's used to add extra data to the intent.
‫The data can be of various types such as strings, integers, booleans, and etc. if we look closer,
‫we have the key and value pairs.
‫The key or the name is the first parameter, which is of type string, and you can see it here.
‫It's a string identifier for the extra data.
‫This key is used to later receive the data from the intent in the receiving activity, and the data
‫to send, which is the value in.
‫The second parameter is the actual data that you want to send.
‫In this case, you can send the boolean byte, char, short int, long float, double string, and whatever
‫you want.
‫I'll pass a key called my name and the value would be Jack.
‫So I'm passing a string as a key and the value a string Jack.
‫Let's go to the second activity which is the receiving activity.
‫And here I need to initialize this text.
‫I need to set this title text view with a past name that we passed with the.
‫Put extra method from the the first activity to the second activity in the Oncreate method of the receiving
‫class, and the second activity I need to create val received data equals to intent dot get string extra.
‫And here I specify the key.
‫If I go back, the key is my name and make sure that you copy it correctly here and paste it because
‫it's case sensitive.
‫Then I need to use the received data as needed.
‫So text view title text view dot text equals to welcome and the received data to our second activity.
‫Okay.
‫This is the second activity.
‫Now let's run our application I'll click this button and here we go.
‫You can see Jack is passed from the first activity to the second activity with the help of put extra
‫method.
‫So I'm passing the value jack with the key my name from the first activity to the second activity.