Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6063977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:13:45+00:00 2026-05-23T09:13:45+00:00

I am using this code snippet to retrieve contact’s email addressees but what I

  • 0

I am using this code snippet to retrieve contact’s email addressees but what I want to do is list the contacts who has got email address. With this method it displays all of the contacts

try {
                list = (BlackBerryContactList) PIM.getInstance()
                .openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);

                PIMItem contact = list.choose();
                if (contact != null) {
                    String emailId = "";

                    for (int i = 0; i < contact.countValues(Contact.EMAIL); i++) {
                        emailId = contact.getString(Contact.EMAIL, i);
                        System.out.println("_ _ _  _ __  EMAIL : " + i + " " +  emailId);
                    }
                }
            } catch (PIMException e) {
                Dialog.inform("Proble creating contact list!");
                e.printStackTrace();
            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:13:47+00:00Added an answer on May 23, 2026 at 9:13 am

    Find below the function which return only those contact list which contains email address:

    /*import email id from the contact list. */
    
    public Vector getEmail()
    {
    
        Vector emailList=new Vector();//contains the list of contact
        email_list.removeAllElements();
        try
        {
            PIM pim = PIM.getInstance();
            ContactList contacts;
            contacts = (ContactList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
            Enumeration items;
            items = contacts.items();
    
            while(items.hasMoreElements())
            {
                Contact contact = (Contact) items.nextElement();
    
                String emailID = "";
                if (contacts.isSupportedField(Contact.EMAIL) && (contact.countValues(Contact.EMAIL) > 0) ) 
                {   
                     emailID=contact.getString(Contact.EMAIL, 0);
    
                    //emailList.addElement(arr);
                }
                String firstName = "";
                if ((contacts.isSupportedField(Contact.NAME)) && (contact.countValues(Contact.NAME) > 0))
                {
                    String[] name = contact.getStringArray(Contact.NAME, 0);
                    firstName = name[Contact.NAME_GIVEN];
                  //  String lastName = name[Contact.NAME_FAMILY];
                }
                String arr[]={emailID,firstName};//array which contains emailid and first name
                emailList.addElement(arr);
    
            }
        }
        catch(Exception pe)
        {
        }
        return emailList;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this code snippet to add KeyDown event handler to any element
I have the following code snippet: using (SPSite site = new SPSite(this.ListAddress)) { using
This is the snippet of code i'm using now: def countOccurences(a, b) #counts the
I'm using this code snippet to encrypt/decrypt data in my app's database: http://www.androidsnippets.com/encryptdecrypt-strings It
I'm using this little code snippet to catch Java processes with certain parameters: string
Using this code to zip a folder and it works perfect on small files
Im using this code for mysql connection $con = mysql_connect(localhost:/var/lib/mysql/mysql.sock, abc , xyz); if
While using this code to serialize an object: public object Clone() { var serializer
When using this code (simplified for asking): var rows1 = (from t1 in db.TABLE1
Im using this code: $(this).css('backgroundcolor', localStorage.getItem('bgColorr') + !important;); When i write: alert( localStorage.getItem('bgColorr') +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.