I am using setContentView(R.layout.main)
to switch the views in the same activity. I am calling some asynchronous task and populating the data on the main layout file after that I am changing the view by calling setContentView(R.layout.main)
method.
I came to know that we should not use setContentView
method multiple times for same activity. Though it is working fine for me.
Can anyone explain why we should not use setContentView
method multiple times for the same activity to change the views?
Will it create any memory related exceptions? Could someone please clarify?