Reputation: 14022
I have a Master Activity and all other Activities of my Application extend it.Also I have a custom view that has animation in it's background.I want to set that custom view in background of my Activities.I can use XML layout with framelayout so that view will be in back of all views in layout of Activity,but each time a new Activity created,a new instance of custom view will be created and it is not suitable.Is there any way to crate a static instance of my custom view and use it in Master Activity in which all child Activities have their layout and custom view be behind of their layout?
Upvotes: 2
Views: 172
Reputation: 14022
I set a Frame layout
with an ID as root view in each layout of all Activities,also I kept previous root as child for new root.Then in code I remove it's child view(really previous root of layout) and add my static custom view to Frame layout
and then add previous root again to the layout.
Upvotes: 1