Search code examples
androidlayoutandroid-activitysharing

2 activities sharing a Layout


I have 2 different activities that share one layout.xml file. If I decide to make alterations such as TextView.setText() in one activity, would the other activity experience the same change? Or do the activities just create different instances of the same layout?


Solution

  • If you alter the view in one activity, the other won't be affected since you can only have one activity shown at a time so the other one will have to be recreated and redrawn on the screen.