Use the method "toArray()"
ArrayList<String> mStringList= new ArrayList<String>();
mStringList.add("ann");
mStringList.add("john");
Object[] mStringArray = mStringList.toArray();
for(int i = 0; i < mStringArray.length ; i++){
Log.d("string is",(String)mStringArray[i]);
}
or you can do it like this: (mentioned in other answers)
ArrayList<String> mStringList= new ArrayList<String>();
mStringList.add("ann");
mStringList.add("john");
String[] mStringArray = new String[mStringList.size()];
mStringArray = mStringList.toArray(mStringArray);
for(int i = 0; i < mStringArray.length ; i++){
Log.d("string is",(String)mStringArray[i]);
}
http://developer.android.com/reference/java/util/ArrayList.html#toArray()