Does someone know how to use onActivityReenter properly?
Asked Answered
B

1

11

I´ve just realised that android has another method called onActivityReenter.

What is this for? can it be used like onActivityResult?

Documentation says that is used for transitions, but not 100% what for.

Brno answered 6/10, 2015 at 8:47 Comment(1)
This is very new. Hope this article could help youNewsmonger
P
11

according to the doc

The purpose of this function is to let the called Activity send a hint about its state so that this underlying Activity can prepare to be exposed. A call to this method does not guarantee that the called Activity has or will be exiting soon. It only indicates that it will expose this Activity's Window and it has some data to pass to prepare it.

so you can get data from the other activity even when it is still running. but for the onActivityResult we get the data when the activity is finished.

Pulido answered 6/10, 2015 at 9:53 Comment(1)
Please check the following questions: 1. Can this be used apart from handling the transitions? I meant to ask is this only restricted to be used only to handle the transition or It can be used for other purposes? 2. Is it expected to be called or applied differently on different devices? I mean behavior of this onActivityReenter is constant or it changes differently on different devices? @PulidoEroto

© 2022 - 2024 — McMap. All rights reserved.