After a long struggle, we found that the issue was raised in devices with latest versions, in which the method "onResume" is not directly called when the app is opened from background mode.
Instead, the onCreate method is called and also it initializes the static variables.
So kindly make sure to check the values of the variables which are necessary for the view.