I want to write a code which allows user to click a button, display the list of people's phone numbers, allowing the user to browse through them and pick one and return it to the parent activity, then display selected contact name and number in a Toast. But not getting how to access the returned contact in parent activity. need help.
I have studied about this in a book. You can follow the steps below.
1. Start your child activity through startActivityForResult method.
2. also use the setResult method. (If you are using an IDE to develop android application. You can find the syntax of the method there. PS :- It has two types of implementation)
3. For fetching the returned result use onActivityResult method