Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6630875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:28:08+00:00 2026-05-25T22:28:08+00:00

How to send HashMap value from one Intent to second Intent? Also, how to

  • 0

How to send HashMap value from one Intent to second Intent?

Also, how to retrieve that HashMap value in the second Activity?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:28:09+00:00Added an answer on May 25, 2026 at 10:28 pm

    Java’s HashMap class extends the Serializable interface, which makes it easy to add it to an intent, using the Intent.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:

    HashMap<String, String> hashMap = new HashMap<String, String>();
    hashMap.put("key", "value");
    Intent intent = new Intent(this, MyOtherActivity.class);
    intent.putExtra("map", hashMap);
    startActivity(intent);
    

    And then in the receiving Activity:

    protected void onCreate(Bundle bundle) {
        super.onCreate(savedInstanceState);
    
        Intent intent = getIntent();
        HashMap<String, String> hashMap = (HashMap<String, String>)intent.getSerializableExtra("map");
        Log.v("HashMapTest", hashMap.get("key"));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I send an email from my smtp server, for example, setting From to anyemail@anydomain.com
I Send Iqueryable to a function that is below void Method<T>(ref IQueryable<T> qu) {
I send out a newsletter email containing URLs to a https website that then
So i want to pass a LinkedHashMap to an intent. //SEND THE MAP Intent
I send some data from my App to a web service and it replies.
I have a service running in my Android application which contains a HashMap that
///Send mail to members whom subscribed to receive mail $one = 1; settype($one, 'integer');
I have an activity class that gets a JSON string by making a query.
I want to send a HashMap object to a ReST resource as a POST
I have a webapp that needs to sometimes download some bytes from a url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.