android - Why my activity's onStop() is not getting called only onPause() is getting called even when my activity is completely not visible? -
i have activity mainactivity
opening activity transactionactivity
problem happening me why mainactivity's
onstop()
method isn't getting called onpause()
getting called. have seen post on difference-between-onpause-and-onstop, , here in answers written when part of activity still visible onstop()
not gets called onpause
called case mainactivity's
not visible why it's onstop()
not getting called ??
is happening because of activity leak
or anything causing activity stay in memory when not visible ??
anyone, please enlighten me happening here ??
my code calling transactionactivity
mainactivity
intent = new intent(mainactivity.this, transactionactivity.class); bundle b = new bundle(); b.putint("trans_type", 0); i.putextras(b); startactivity(i); overridependingtransition(0, 0);
when call activity previous one, placed "beneath" new one. once press, previous activity shown. default bahavior in android.
onstop called when activity finished. could, instance, call activitya.finish() after startactivity(activityb).
still not sure why need code in onstop method. dangerous since system can call onstop if needs free memory. there's better way trying achieve.
good luck!
Comments
Post a Comment