我需要将内容提供程序查询的一部分转换为String[]格式。目前我使用的代码如下:
String[] selectionArgs = {"",""};
selectionArgs[0] = Integer.toString(routeScheduleID);
selectionArgs[1] = runDate.toString();
但是在这种情况下,我有未知数量的元素。
我怎样才能在运行时更改数量(或使用类似数组并转换回String[]的东西)?这可能吗?
List<String>
吗? - Louis WassermanArrays.asList
和List
API。 - Dave Newton