Code example for DatePicker

Methods: setVisibility

0
 
		dueDate.setVisibility(View.GONE);
		cbDueDate.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			@Override 
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				dueDate.setVisibility(isChecked?View.VISIBLE:View.GONE);
			} 
		}); 
 
		Button save = (Button) findViewById(R.id.edit_task_save);
		save.setOnClickListener(new OnClickListener() {
			@Override 
			public void onClick(View v) {
				save(); 
			} 
		}); 
 
		// edit 
		if (getIntent().getData() != null) {
			Cursor cursor = getContentResolver().query(getIntent().getData(), null, null, null, null);
			if (cursor.moveToFirst()) {