I try to add a View at the same place of an other View in a ConstraintLayout but the added View don't get the LayoutParams of the other View.
The added View take place on the top|left of the container.
This is my code :
TextView cloneView = new TextView(getContext());
cloneView.setLayoutParams(otherView.getLayoutParams());
mainContainer.addView(cloneView);