Tuesday, 6 August 2013

Arrays.asList().contains() giving wrong result

Arrays.asList().contains() giving wrong result

Code :
private static final int[] GOOGLE_DIRECTION_ID_FOR_MATCH = { 11, 12, 13,
14, 15 };
Log.e(TAG, "index : "
+
Arrays.asList(GOOGLE_DIRECTION_ID_FOR_MATCH).indexOf(11));
Log.e(TAG, "contains : "
+ Arrays.asList(GOOGLE_DIRECTION_ID_FOR_MATCH)
.contains(11));
Above statements logs :
index : -1
contains : false
I tried for all other values, too.

No comments:

Post a Comment