Created
April 12, 2019 04:10
-
-
Save nguyenlinhnttu/3600a42d44adb70d5a15bd7f5642e7f8 to your computer and use it in GitHub Desktop.
Convert List<Integer> top Int[]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int[] toIntArray(List<Integer> list) { | |
int[] ret = new int[list.size()]; | |
for (int i = 0; i < ret.length; i++) | |
ret[i] = list.get(i); | |
Log.d("ret", Arrays.toString(ret)); | |
return ret; | |
} | |
private String[] toStringArray(List<String> list) { | |
return list.toArray(new String[list.size()]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment