Whenever I am connecting two widgets the starting element will no longer show up. Unfortunately I have no idea what's the cause of this problem. The ConstraintLayout myLayout is already inflated within another layout.
ConstraintLayout myLayout= getActivity().findViewById(R.id.myID);
myLayout.removeAllViews();
ConstraintSet constraintSet = new ConstraintSet();
CheckBox cb = new CheckBox(myLayout.getContext());
cb.setText("CHECKBOX");
cb.setId(View.generateViewId());
myLayout.addView(cb);
constraintSet.connect(cb.getId(),ConstraintSet.END,myLayout.getId(),ConstraintSet.END);
constraintSet.connect(cb.getId(),ConstraintSet.TOP,myLayout.getId(),ConstraintSet.TOP);
constraintSet.applyTo(myLayout);