use*_*345 3 java android arraylist
我有3个布尔值表示是否应该将int添加到列表中,然后我想TextUtils.join()在此列表中使用.
我该怎么办?
ArrayList<Integer> types = new ArrayList<Integer>();
if (m_bWithA) {
types.add(this.TYPE_A); //TYPE_A is an int
}
if (m_bWithB) {
types.add(this.TYPE_B);
}
if (m_bWithC) {
types.add(this.TYPE_C);
}
TextUtils.join("|", types);
Run Code Online (Sandbox Code Playgroud)
但它说,我们只能使用TextUtils.join()上Object[].
我应该使用其他功能还是不同类型的对象?
| 归档时间: |
|
| 查看次数: |
4144 次 |
| 最近记录: |