Android. Calling Dismiss On A Dialog
Solution 1:
Solution 2:
In java memory can only be free by Garbage Collector and you can only make all that object to be null so that garbage collector can collect memory to free.
Why do you need this? The entire point of Java is that it takes care of memory management for you. Do you have some obvious memory issues or something?
Solution 3:
The Google Android Developer Documentation say :
public void dismiss () : Since: API Level 1 Dismiss this dialog, removing it from the screen. This method can be invoked safely from any thread. Note that you should not override this method to do cleanup when the dialog is dismissed, instead implement that in onStop().
Solution 4:
Manually free
ing memory is
Not doable in Java. You can allocate memory with
new
, but the Garbage Collector takes care of freeing itA bad idea when you have a Garbage Collector trying to work behind.
dismiss()
simply hides the dialog. Call removeDialog(int)
to remove all the references to it and wait for the GC to kick in.
Post a Comment for "Android. Calling Dismiss On A Dialog"