Search code examples
android-studioviewcopy-paste

AndroidStudio: How to copy view and autocreate unique IDs?


When I started in AndroidStudio there was a posibility to copy a layout (for example ConstraintView with a TextView in it) and AndroidStudio created new Unique IDs of those views.

This it not working anymore. Where can I change those settings?

Problem

When I copy a view it will also take the same IDs of this views.

enter image description here

What I want

When I copy a view I want to have new IDs and not manually rename them.

enter image description here


Solution

  • If you would like to copy the view inside ConstraintLayout manually, Android Studio gives them automatically new IDs, but you can't copy the constraintLayout and all contents inside manually with new IDs, you can just do it programmatically.