Adler
Adler

Reputation: 1492

Android - get the activity result when the calling activity finished

is there a way to get result from activity to one activity before the calling activity becuse the calling activity have noHistory attribute and the back button passing me to the one before?!

thanks for the help!

Upvotes: 2

Views: 2791

Answers (3)

Paresh Mayani
Paresh Mayani

Reputation: 128448

Yes obvious you just need to start the new activity by using startActivityForResult()

Here is the full description for the implementation of this method.

Brief Description: You just need to start the target activity by using startActivityForResult() method same as we do by using startActivity(). Now it will redirect you in target activity, residing inside it, do all the processes and at the end just call setResult() method. So it will again get back to you in Source activity. Inside this you need to override the onActivityResult() method. Here you get the result from target activity.

Upvotes: 1

Jonathan Schneider
Jonathan Schneider

Reputation: 27757

This is a decently short explanation of how the Activity result process works:

http://saigeethamn.blogspot.com/2009/08/android-developer-tutorial-for_31.html

Look for the "Starting Activities and Getting Results" heading under the Activity documentation in the stock Android documentation:

http://developer.android.com/reference/android/app/Activity.html

Upvotes: 1

Related Questions