android - How can I tell if a Dialog is being Stopped by it closing or by the application being minimized? -


i implement dialog should update calling activity when closed. however, i've found updating activity when entire application minimized, not acceptable purposes.

the update activity occurs in dialog's onstop() method, called either when dialog closed or application stopped. how can handle things differently based on whether dialog closed or application stopped? thanks!

for more context, here piece of dialog's onstop(), resumes timer of underlying activity. don't want timer resumed if user leaving app.

if (activity instanceof quizactivity) {             if( ((quizactivity) activity).gettimer() == null) {                 ((quizactivity) activity).resumetimer();             }         } 

i think solved this. dialog's onstop() being called manually activity's onstop(). put call pausetimer() method after calling dialog's onstop() in activity's onstop(). effectively, dialog resuming timer , activity pausing again part of onstop() method. doesn't feel clean, @ least holds together.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -