I have an App, where I load images from a server. Because of this my app leads to Outofmemory Error.
I have caught the exception so that my app is now prevented from being force closed. But my app stops loading images in the place where the exception has occurred. So is there a way I could restart my activity after the exception has been caught, so that my memory is freed up and activity loads images from the first once again.
Much needed. Any help is appreciated.
Restarting the current activity all of a sudden is not going to be a great User experience.
If possible try clearing Images from memory that are not not shown to the user(so it releases memory that it has occupied).
If still you want to restart the current activity, use the following: