android - What exactly happens when finish() is called on a non-top activity -


suppose somehow have reference activity not on top of activity stack. can call finish() on activity, , happen in such case?

also, legitimate reason hold on reference non-top activity? saving reference in static field way have access non-top activities against best practice.

finish() on activity, , happen in such case?

i'm sure can. end black screen non-top activity if still visible on screen.

also, legitimate reason hold on reference non-top activity?

i think have consider whether design correct if have keep reference activity in background. lead lot of memory leaks if keep old activity hanging around gc cannot collect.

saving reference in static field way have access non-top activities

you should use class constants.java put in static fields non-top activity , reuse values constants.java.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -