in your XML:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingTop="8dp">
<Button
android:id="@+id/btCalculator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="click" />
<CheckBox
android:id="@+id/cbVar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</LinearLayout>
in your Java Class:
before OnCreate:
Button btCalculator;
CheckBox cbVar;
in OnCreate:
cbVar= findViewById(R.id.cbVar);
btCalculator = findViewById(R.id.btCalculator);
btCalculator.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
cbVar.setVisibility(View.VISIBLE);
}