Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put HashMap<Integer, List<Integer>> in savedInstanceState

I have a problem with adding values in savedInstanceState in Android. I tried to find solution on the internet, but I cannot seem to find a solution. Maybe some of you might know where the problem is. I need to put HashMap> to savedInstanceState, and retrieve that onCreate method. Has anyone encountered and solved this problem? Thank you for your time.

like image 888
marko kurt Avatar asked Jan 09 '23 14:01

marko kurt


1 Answers

you can use putSerializable. E.g.

savedInstanceState.putSerializable("KEY", hashMapInstance);
like image 156
Blackbelt Avatar answered Jan 27 '23 18:01

Blackbelt