This question already has an answer here:
I'm new to android with almost no knowledge about Java and XML. I'm learning it through pdfs that i'm getting on net. I have learnt about Toast, a bit about Intents but me not able to understand anything about Bundles. I have understood that they are used to pass data from one activity to another but I'm not able to implement this.
please give a simple example to implement the same.
as for example I have just created two activities namely , Main_Activity and Other_Activity, and i haven't done anything to them yet.
Please give the simplest example so that i can learn to implement.
Thanks in advance!!
Basically this is what you need to do:
in the first activity:
and in the second activtiy:
one of the get-functions will give return you the value, depending on the datatype you are passing through.
Try this: if you need pass values between the activities you use this...
This is code for Main_Activity put the values to intent
This code for Other_Activity and get the values form intent
For example :
In MainActivity :
In OtherActivity :
More informations here : http://developer.android.com/reference/android/content/Intent.html