File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fetching contacts from phone book

 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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.

Thanks in advance
 
Mohan Prasath
Ranch Hand
Posts: 38
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

For Example, refer the following notepad example Notepad Example
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mohan Prasad,
I know these steps but not getting how to implement onActivityResult() method. I'm using implicit intent. So i cant call nethod setResult() inside activity displaying phone book.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic