Search code examples
androidandroid-activityapplication-lifecycle

startActivityForResult triggers TRIM_MEMORY_UI_HIDDEN thinking it went to the background


How do I prevent using startActivityForResult in an activity from thinking it went to the background in the ApplicationLifecycleHandler?


Solution

  • If you call startActivityForResult(), and it is starting up an activity that is not yours, then your app is moving to the background, and so the TRIM_MEMORY_UI_HIDDEN value is correct.