The easy way is to instantiate all your TextView's and then use the setText() method to change their text.
textView1.setText("One");
The other way is to get all the TextViews as child of your parent layout (like LinearLayout or the one you are using and using getChildAt method)
LinearLayout ll = //Your Layout this can be any Linear or Relative layout
//in which you added your spinners at runtime ;
int count = ll.getChildCount();
for(int i =0;i<count;i++)
{
View v = ll.getChildAt(i);
if(v instanceof TextView)
{
// you got the spinner
EditText s = (EditText) v;
if(s.getID() == R.id.textView1){
textView1.setText("One");
}
}
}
The first one is easier and simpler. I prefer this. Hope I helped. :)
EDIT - Supoose on first click of the button you want the TextViews to have name of days and ont the next it displays numbers, the code will be:
//You can also use List here
String [] days = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
String [] nums = {"1","2","3","4","5","6","7"};
//Your method to update the TextViews
public void updateTextViews(String [] texts){
textView1.setText(texts[0]);
textView2.setText(texts[1]);
textView3.setText(texts[2]);
textView4.setText(texts[3]);
textView5.setText(texts[4]);
textView6.setText(texts[5]);
textView7.setText(texts[6]);
}
//Count the number of clicks, (or the condition on which you want to change the text displayed)
int counter = 1;
//your ImageBUtton's onClick() method
@override
public void onClick(View v){
//Check the click count (or your condition)
switch(counter){
case 1: //first click
updateTextViews(days);
break;
case 2: //second click
updateTextViews(nums);
break;
default:
//This is executed when no case matches.
break;
}
**counter = counter + 1;**
}