HashMap is basically an implementation of map and this is not synchronized. HashMap basically contains key value pair data.
From sending activity we can create and send hashmap value like this :
HashMap<String, String> mHashMap= adapter.getItem(position);
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
intent.putExtra("hashMap", mHashMap);
startActivity(intent);
Second Activity: in our second activity we can get hashMap data but using getSearializedExtra like this :
Intent intent = getIntent();
HashMap<String, String> hashMap = (HashMap<String, String>) intent.getSerializableExtra("hashMap");
0 Comment(s)