What’s the correct way to pass a bundle to the activity that is being launched from the current one? Shared properties?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have a few options:
1) Use the Bundle from the Intent:
2) Create a new Bundle
3) Use the putExtra() shortcut method of the Intent
Then, in the launched Activity, you would read them via:
NOTE: Bundles have “get” and “put” methods for all the primitive types, Parcelables, and Serializables. I just used Strings for demonstrational purposes.