Android 无法将现有文本视图从xml设置为文本视图数组
我的Xml文件中有2个TextView,我在TextView数组中设置了它们。如何根据索引访问它们 请帮我解决这个问题Android 无法将现有文本视图从xml设置为文本视图数组,android,textview,Android,Textview,我的Xml文件中有2个TextView,我在TextView数组中设置了它们。如何根据索引访问它们 请帮我解决这个问题 Textview a,s,d,f,g,h; intialize all; TextView[] text_arrays; text_array = new TextView[]{a,s,d,f,g,h}; 现在做你想做的 text_array[0].setText("Text View One); text_array[1].setText("Text View two);
Textview a,s,d,f,g,h;
intialize all;
TextView[] text_arrays;
text_array = new TextView[]{a,s,d,f,g,h};
现在做你想做的
text_array[0].setText("Text View One);
text_array[1].setText("Text View two);
text_array[5].setText("Text View six);