Getting a Result from an Activity

Beginning another movement doesn’t need to be one-way. You can likewise begin another action and get an outcome back. To get an outcome, call startActivityForResult() (instead than startActivity()).

For instance, your application can begin a camera application and get the caught photograph subsequently. On the other hand, you may begin the People application all together for the client to choose a contact and you’ll get the contact subtle elements subsequently.

Obviously, the action that reacts must be intended to give back an outcome. When it does, it sends the outcome as another Intent article. Your movement gets it in the onActivityResult() callback.

Example –

Receive the Result

At the point when the client is finished with the ensuing movement and returns, the framework calls your action’s onActivityResult() strategy. This strategy incorporates three contentions:


Partner Sites