Skip to content

Instantly share code, notes, and snippets.

@nguyenlinhnttu
Created April 12, 2019 04:10
Show Gist options
  • Save nguyenlinhnttu/3600a42d44adb70d5a15bd7f5642e7f8 to your computer and use it in GitHub Desktop.
Save nguyenlinhnttu/3600a42d44adb70d5a15bd7f5642e7f8 to your computer and use it in GitHub Desktop.
Convert List<Integer> top Int[]
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