Reputation: 11
I am using a RelativeLayout for my whole screen. The images on the screen appear and disappear almost randomly, and it often happens that the same image is displayed multiple times. However, when this happens, I get an error saying: "Child already has a parent....".
Do you guys know any way around this? I thought I could probably dynamically change the reference ID for each ImageView that is called onto the screen, but as I will have probably like 50+ imageviews on the screen, dynamically changing positions, disappearing and coming back, wouldn't that slow down the program a lot?
Upvotes: 0
Views: 316
Reputation: 51
Each View
must have on Parent
that when added to it ,it can't be added to another Parent
.
if you want you can cache the bitmap
some where and apply it to different ImageViews
. so both imageviews
will have the same bitmap
. but you cant have the same ImageView
in different Parents .
Upvotes: 4