I have a ImageButton
and when I click on it I want the Background
of it to pass to another ImageButton
.
I have View v
of the first ImageButton
, and imgB6
is the ImageButton
I want to get the background of v, and gives error in v.getBackground()
:
findViewById(R.id.imgB6).setBackgroundResource(v.getBackground());
v.getBackground()
is giving error I do not know why, since it is a drawable.
v
is received per parameter when in method Onclick
, and has a corresponding drawable
!
I wanted to pass Backgound
from v(View)
to imgB6(ImageButton)
.