android - onStop not being called ... Home button pressed -


in main activity, under onstop, set myvar = true. in onresume, check if myvar = true , something.

if hit home button while on main activity , launch again home screen/app drawer, works correctly.

if hit home button while on different activity , launch again home screen/app drawer, brings main activity have cleartaskonlaunch="true" set on main activity , android:finishontasklaunch="true" set on other activities. however, doesn't appear hit onstop in main activity when home button pressed.

i start other activities result. if result code = result_ok or result_canceled, set myvar = false. but... if home button pressed, shouldn't setting results , doing onactivityresult.

any idea how solve this?

edit:

above oncreate.. set startnew = true; @override     public void onstop() {         super.onstop();         startnew = true;     }      @override     public void onrestart() {         super.onrestart();         if (startnew) {             getcurrentdate(0);             updatedisplay();             filldata();         }     } 

the other reference startnew, in onactivityresult method, if activity launched main activity returns either result_ok or result_canceled, set startnew = false.

i'm trying ensure every time app launched home screen / app drawer, runs 3 methods.

move onpause() because, per documentation, onstop() in situations not invoked.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -