Reputation: 1706
I need to completely free the memory which was in use by an Activity
when the user closes that Activity. will using
android:noHistory="true"
be enough?
Upvotes: 1
Views: 119
Reputation: 38168
By saying
android:noHistory="true"
you tell android not to keep a reference of your activity inside the back stack of activities. That's already a good start.
The only thing that remains to be done is to be sure that you don't keep a reference yourself to your activity. For instance, don't :
If you don't keep any reference to it, and add the noHistory flag, then you can be sure it will be garbage collected.
Also, note that you can use MAT with eclipse to get sure that there is no instance of your first activity as soon as you reached the second activity.
Upvotes: 2