I have a TabHost set up with tabcontent. However, this tabcontent doesn't take up the entire screen and a different layout is loaded at the top. How can I change the image in the layout above from within the on create of a tab activity?
Thanks,
I have a TabHost set up with tabcontent. However, this tabcontent doesn't take up the entire screen and a different layout is loaded at the top. How can I change the image in the layout above from within the on create of a tab activity?
Thanks,
You will not be able to access Activity A's view from Activity B; this is because it's very possible that the view will be destroyed when you launch Activity B.
What you can do however is somehow let Activity A know to change the ImageView when you come back. For example, you can have a static field or you can use setResult()
.
I see Three ways:
1.Share the ImageView between two activities. To do that, you can put this element as private and create a getter. Then, you just have to access this element and change the element. I'm not sure that will work.
2.preferred way Load your image in onResume from a remote source. Then, you juste have to change this remote path from your second activity.
3.previous response