Code example for TimePicker

Methods: setVisibility

0
			@Override 
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				// TODO Auto-generated method stub 
				if ( isChecked != ignoreTime ) {
					ignoreTime = isChecked;
					timePicker.setVisibility(ignoreTime ? View.GONE : View.VISIBLE);
				} 
			} 
		}); 
         
        ignoreTime = chbxIgnoreTime.isChecked();
        timePicker = (TimePicker) findViewById(R.id.timePicker);
        timePicker.setVisibility(ignoreTime ? View.GONE : View.VISIBLE);
        timePicker.setIs24HourView(true);
    } 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true; 
    }