In my Android application, I want to duplicate an ImageButtonalready created one ImageButton.
I want to create a new ImageButtonprogrammatically having the same widht, height, background, image src, fields, etc. an already created button in an XML file. In short, I want to create a duplicate ImageButton.
I tried this
ImageButton mImageButton = (ImageButton) findViewById(R.id.ib);
Imagebutton duplicate = mImageButton;
But this only applies to mImageButton. Thus, the change duplicatealso causes a change in mImageButton.
Please help me. Thank...
source
share