Is it necessary to keep a reference to your spawned AlertDialog in your Activity and dismiss it in onDestroy() or could you just create it and forget it? It seems to be dismissed when your leave the Activity?
I suppose the AlertDialog holds a reference to the Activity Context normally, which might prevent the Activity from being garbage collected. What is the procedure to avoid possible memory leak here?
Does an AlertDialog belong to the Activity, i.e. does it follow the Activity lifecycle, being destroyed at the same time as the Activity and so on...?