Hi,
I have a HorizontalScrollView.
In it, I have 3 TextViews and i have set it in a for loop as below:
public viod setActiveFeature(int no){
activeFeature = no;
}
void display(){
for(int i = 0; i < 3; i++){
//add TextView.
textView[i].setText("textView" + i);
layout.addView(textView[i] //layout with
horizontalScrollView...
}
hScrollView.smoothScrollTo( activeFeature *
hsv.getMeasuredWidth());
}
So, if I have set the variable activeFeature = 1; In the end, it
should show the 2nd textView.... but it always displays the first
textview of the scrollView.
If I call the display() method for the first time, it does not work,
but then after it displays the textView depending on the variable
"activeFeature" is set to.
Why it does not happen for the first time? Can anyone help?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en