In my application, I always want the user to start from the Splash screen. For example, my application may be open in the background, and some kind of notification appears that triggers a burst of activity. This should terminate all previous actions that have been performed.
I accomplished this by keeping a list of all links to current actions. And when a surge of activity begins, it just causes
for(runningActivity : runningActivitiesList) { runningActivity.finish(); }
This solution works well. However, Android Studio warns about a memory leak when storing action links.
Can someone suggest me a better approach that avoids memory leaks?
source share