• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Fetching contacts from phone book

 
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 38
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic