Android avoids memory leaks
That is, the recycled memory is not recycled for various reasons and still resides in the memory.
Maybe a small memory leak will cause the whole application to jam or even crash.
This code may have a memory leak.
If the toast holds the current activity before the toast disappears, and the user clicks the return key, the activity cannot be recycled by GC (garbage collection garbage collection), and the activity will cause memory leakage.
All contexts unrelated to the current activity can be passed in. The method to avoid memory leakage also uses other places where context needs to be passed in. I can't understand this sentence
Getapplicationcontext () is the context of the whole application and will not hold an activity object.
The context of dialog cannot use getapplicationcontext (). The program will crash. The instantiation of dialog must hold the activity object.