Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between sparsearray and sparsearraycompat

Tags:

android

sdk

what is difference between Sparsearray and Sparsearraycompat.

Sparsearraycompat is a copy of the current platform

(currently { @ link android.os.Build.VERSION_CODES#KITKAT } version of { @link android.util.SparseArray};

provides a removeAt() method and other things.

It's means Sparsearray can use everywhere except KITKAT? why not always use Sparsearray ?

like image 995
user5164480 Avatar asked Dec 14 '16 10:12

user5164480


1 Answers

SparseArray api was changing and improving as newer and newer versions of SDK were released. SparseArrayCompat is implementation of SparseArray that is distributed trough the support library, so you can use the most fresh api on old SDKs as well.

like image 56
SadClown Avatar answered Nov 17 '22 21:11

SadClown