Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 无法将现有文本视图从xml设置为文本视图数组_Android_Textview - Fatal编程技术网

Android 无法将现有文本视图从xml设置为文本视图数组

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);

我的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);
text_array[5].setText("Text View six);