I have an action in which the first thing he does is launch another action for the result. when the result returns, he must process it and then finish. I have a call to startActivityForResult() in onCreate() .
I see that sometimes, when I return from the target activity that I started, onCreate() in my activity is called again. this, of course, restarts the target activity a second time.
It makes sense, and I understand why it is, but I do not understand the correct model of what I'm trying to achieve. When I return from the activity that I started, I do not want to restart the target activity again ... I just want to start onActivityResult() and complete.
I read where someone suggested setting a preference for a state, but this seems like a good source of errors, for example if it is stuck in an incorrect state.
Any thoughts?
source share