I am populating JSON parsed data into Dialog, like this:
String[] colors = new String[] {cArrayList.toString()};
Log.d("colors::-", Arrays.toString(colors));
GETTING
EXPECTED
As per your requirement you can do following if your cArrayList is ArrayList
Alternatively, you can use the more concise and faster approach:
|
|||||||||||||||||||||
|
Like in Core Java you convert
View reference How to convert int[] into List in Java? |
||||
|
To convert your integer value to a string use:
|
|||||
|
String[] colors = new String[]{ cArrayList.size() };
What are you attempting to do here? Create an array of Strings of that size or put the size of that arraylist as the first element in the colors array? – Marc Baumbach Sep 19 '15 at 5:06