Skip to content Skip to sidebar Skip to footer

Hide A Edittext & Make It Visible By Clicking A Menu

I have a layout having the contact deatils of the phone. When i click the option menu i need make an edittext visible in that screen. I have done it. But there is problem facing t

Solution 1:

Try phoneNumber.setVisibility(View.GONE);


Solution 2:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.waist2height); {
        final EditText edit = (EditText)findViewById(R.id.editText);          
        final RadioButton rb1 = (RadioButton) findViewById(R.id.radioCM);
        final RadioButton rb2 = (RadioButton) findViewById(R.id.radioFT);                       
        if(rb1.isChecked()){    
            edit.setVisibility(View.VISIBLE);              
        }
        else if(rb2.isChecked()){               
            edit.setVisibility(View.INVISIBLE);
        }
}

Post a Comment for "Hide A Edittext & Make It Visible By Clicking A Menu"