I have two activities say X and y. In x there is edittext n 6 radiobutton if user clicks button the value gets retrieved from database based on input from edittext n radiobutton. the values should be displayed in next activity y. can yu pls help in giving snippet..thanks in advance
Share
You can easily pass data from one activity to another using Bundle or Intent.
Lets look at the following example using Bundle:
In “NextActivity” you can retrieve the data using the following code:
How about using only Intent to transfer data. Lets look at the example
In “NextActivity” you can retrieve the data:
Now you would ask me, whats the difference between Intent and Bundle, they seems like
they do exactly the same thing.
The answer is yes, they both do exactly the same thing. But if you want to transfer alot of data, variables, large array you would need to use Bundle, as they have more methods for transferring large amount of data.(i.e. If your only passing one or two variable then just go with Intent.