I was using bundle.getSerializable("data") as HashMap<Int, Int>
but after changing sdkVersion
to 33
.getSerializable()
API is updated.
I am unable to implement it for HashMap<Int, Int>
I tried -
savedInstanceState.getSerializable("answer", HashMap<Int, Int>::class.java)!!
but it gives warning -
Only classes are allowed on the left hand side of a class literal
After some searching I found this stack post
The respective answer(above cited) quote -
You can't use generics with
class
Now I am not getting the solution of this problem. Any suggestion?