title: Create image file from XML file in android during runtime
body: <p>I have two activities in an application that I am working on at the moment. The picture describes more.<img src="https://i.stack.imgur.com/AIjpW.png" alt="Activities"></p>
  
  <p>The red rectangle in Activity A represents a particular child layout that holds <code>ImageView</code>s which are dynamically changed as the application runs and user assigns images to those <code>image views</code>. Now in the Activity B,the red rectangle is the image of the red rectangle from Activity A(only red portion not the whole layout file) along with the dynamically added images (i e like screenshot of the things inside the red rectangle along with the red rectangle ). I have been searching over the internet for a solution and could not find a reasonable solution to it and I personally tried with screenshot but this goes not give the right result. So if you have any ideas about how this could be done then I would like to kindly request for your opinion , answer . Anything is highly appreciated. Thank you in advance.</p>