我想把當前顯示的字符串從TextSwitcher
(字符串將被置於一個的字符串數組中)與其他字符串數組,我不知道哪一種方法,我應該做的,因爲.getText
不`噸工作textSwitcher。從TextSwitcher添加字符串數組
如何加載和添加字符串到現有的但不使用在這個活動字符串數組?
我在網上找到了這個方法,爲什麼它不起作用?
Resources res = getResources();
String[] favorites = res.getStringArray(R.array.favorites);
String[] planets = res.getStringArray(R.array.planets_array);
String[] temp = new String[favorites.length+1];
System.arraycopy(favorites,0,temp,0,favorites.length);
temp[favorites.length] = planets[mCounter];
favorites = temp;