java – Revert programmatically set UI changes in Android Studio-ThrowExceptions

Exception or error:

I have a full screen messenger dialog that has a minimize button which will make that dialog a smaller window that you can drag around the screen. Like facebook messengers little widget when you go back to the home screen just with more or less the same functionality as the fullscreen page.

I may be taking the wrong approach to this so please correct me. However, I still want to be in the app when I minimize from full screen. So what I do is change the size of the dialog to 300 height by 200 width, set the visibility of some items to gone and I change the constraints and text sizing of certain textviews that I want to use on the mini dialog.

Now when I go to click the mini dialog I want to to expand back to full screen. However all my items are all over the place because the constraint and sizing are all changed.

Is there an easy way to revert back to the original xml attributes? I tried to setContentView on the dialog again but it canceled my session with the other person. Do I really have to change the sizing and try to compare it with the original?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *