SparseArray<Object>
is great a way to avoid autoboxing if you want to use a primitive key. What if you want to use a primitive value? Something like SparseArray<int>
(if it existed)?
I want to make an int
to an int
.
SparseArray<Object>
is great a way to avoid autoboxing if you want to use a primitive key. What if you want to use a primitive value? Something like SparseArray<int>
(if it existed)?
I want to make an int
to an int
.
There is no way to do it. Java does not allow primitive types to be used as type arguments in generic types. You'll have to use the wrapper type Integer
.