Hi,
 I am a new Andriod Developer and I am trying to write a very simple 
activity. The activity uses LinearLayout with vertical orientation. It has 
3 controls - button, textview, and another textview. All I want to do is 
that when the button is clicked, the visibility of the textview in the 
middle is toggled between VISIBLE and INVISIBLE. So I have written the 
onClick handle like so:

public void onClickMe(View view){
TextView thetext =(TextView)findViewById(R.id.thetext);
if(displayText){
thetext.setVisibility(TextView.INVISIBLE);
} else {
thetext.setVisibility(TextView.VISIBLE);
}
findViewById(R.id.optionView).invalidate();
thetext.invalidate();
findViewById(R.id.optionView).getParent().requestLayout();
//thetext.requestLayout();
  displayText =  !displayText;
}

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

Reply via email to