Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.support.v4.util.Pair vs android.util.Pair

I read about support.v4 lib that allows android backward compatibility.

So IIUC, when there is an ambiguity - it's always best practice to import the lib from android.support.v4 ...

right?

enter image description here

like image 427
Elad Benda Avatar asked Aug 25 '15 21:08

Elad Benda


1 Answers

Yeah, it's wise but not always needed.

I this case Pair is API 5 and quite usefull class so it was added to v4library.

Another example are Fragments. If you want to use ViewPager with Fragments most probably you need Fragments from v4 as ViewPager is from v4 as well...

like image 178
pelotasplus Avatar answered Nov 02 '22 11:11

pelotasplus