To convert an ArrayList<String> object to a String[] array in Java use toArray() method without passing any argument renders Object. So you have to pass an array as an argument, which will be packed with the data from the list, and returned. You can pass an empty array too, but you can also pass an array with the wanted size.
Syntax:
List<String> list = ..;
String[] array = list.toArray(new String[0]);
Example:
ArrayList<String> list = new ArrayList<String>();
list.add("lion");
list.add("king");
String[] array = list.toArray(new String[list.size()]);