Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android immediately created Pair elements are null

As show in the image, I create a Pair of String but they are null (as shown in the debugger)

enter image description here

What's wrong? I'd really like to avoid littering my project with a reimplementation of Pair<A, B>

like image 825
JSelser Avatar asked Mar 14 '16 04:03

JSelser


2 Answers

Use android.support.v4.util.Pair instead of android.util.Pair

like image 72
rafaelc Avatar answered Oct 28 '22 19:10

rafaelc


Using androidx.core.util.Pair instead of android.util.Pair should also work with unit tests

like image 38
Alexander Dobrolubov Avatar answered Oct 28 '22 19:10

Alexander Dobrolubov