How to send HashMap value from one Intent to second Intent?
Also, how to retrieve that HashMap value in the second Activity?
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.
Java’s HashMap class extends the
Serializableinterface, which makes it easy to add it to an intent, using theIntent.putExtra(String, Serializable)method.In the activity/service/broadcast receiver that receives the intent, you then call
Intent.getSerializableExtra(String)with the name that you used with putExtra.For example, when sending the intent:
And then in the receiving Activity: