How to add new elements to an array?

后端 未结 18 1711
误落风尘
误落风尘 2020-11-22 04:55

I have the following code:

String[] where;
where.append(ContactsContract.Contacts.HAS_PHONE_NUMBER + \"=1\");
where.append(ContactsContract.Contacts.IN_VISIB         


        
18条回答
  •  情话喂你
    2020-11-22 05:33

    I've made this code! It works like a charm!

    public String[] AddToStringArray(String[] oldArray, String newString)
    {
        String[] newArray = Arrays.copyOf(oldArray, oldArray.length+1);
        newArray[oldArray.length] = newString;
        return newArray;
    }
    

    I hope you like it!!

提交回复
热议问题