In my project I have an array of three days:
String[] days = {"Friday", "Saturday", "Sunday"};
These are added to a ViewFlipper programmatically as shown here:
ViewFlipper vf = (ViewFlipper) findViewById(R.id.view_flipper);
TextView textview = new TextView[numDays];
LinearLayout layout = new LinearLayout[numDays];
for(int i = 0; i<numDays; i++){
layout[i] = new LinearLayout(this);
vf.addView(layout[i]);
textview[i] = new TextView(this);
textview[i].setText(data.days[i].name);
layout[i].addView(textview[i]);
}
But when I go to the ViewFlipper when I load my app it appears in this order:
Friday --- Sunday --- Saturday
Does anybody know why this happens?
and