Android, how to populate a CharSequence array dynamically (not initializing?)

后端 未结 6 1581
旧时难觅i
旧时难觅i 2021-01-07 18:19

How do I change something like this:

CharSequence cs[] = { \"foo\", \"bar\" };

to:

CharSequence cs[];

cs.add(\"foo\"); //          


        
6条回答
  •  北荒
    北荒 (楼主)
    2021-01-07 19:11

    You could use ArrayList instead of raw arrays since need to add items dynamically.

提交回复
热议问题