It should be simple but I couldn't find the easy one line answer. How can I change CharSequence[] to String[]. My goal is to change CharSequnce[]={"a","b","c"} to List<String>, but when I write Arrays.asList(a) android studio gives an error saying that Required type is List<String> but the Provided is List<CharSequence>. So it seems I need to change CharSequence array to String array first.
I also tried Arrays.asList(Arrays.toString(e)) but the output of printing the List will be [[a, ,b, c]], which is not what I want.
CharSequence[]={"a", "b", "c"}is assigning a right-handString[]toCharSequence[], which begs the question: why are you usingCharSequenceto begin with? You could of course map these things:Arrays.stream(a).map(Object::toString).toList(), but that's seemingly wasteful compared to fixing your stored data to begin with.Stringis aCharSequence? TheStringclass implements theCharSequenceinterface.TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MultiSpinner); CharSequence[] entries = a.getTextArray(R.styleable.MultiSpinner_android_entries);