View Single Post
Old 09-16-2009, 09:18 AM   #12
pgoeol
Thumbs Must Hurt
 
Join Date: Sep 2009
Model: 8100
PIN: N/A
Carrier: Airtel
Posts: 75
Default

there must something u r doing in wrong manner... i've tried the same thing and it is working correctly on my end...

following are the code snippets i've used

for JDE 4.3

Code:
BlackBerryContactList contacts = (BlackBerryContactList)BlackBerryPIM.getInstance().openPIMList(BlackBerryPIM.CONTACT_LIST, BlackBerryPIM.READ_WRITE);
    			BlackBerryContact contact = (BlackBerryContact)contacts.choose();

    			if(contact!=null){
    				int numValues = 0;
    				numValues = contact.countValues(BlackBerryContact.TEL);
    				for (int i = 0; i < numValues; i++) {
    					if (contact.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_MOBILE) {
    						mobileNumber = contact.getString(BlackBerryContact.TEL, i);
    						break;
    					}
    				}
    			}
for JDE 4.2

Code:
BlackBerryContactList contacts = (BlackBerryContactList)PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
    			BlackBerryContact contact = (BlackBerryContact)contacts.choose(null,BlackBerryContactList.AddressTypes.PIN,true);

    			if(contact!=null){
    				int numValues = 0;
    				numValues = contact.countValues(BlackBerryContact.TEL);
    				for (int i = 0; i < numValues; i++) {
    					if (contact.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_MOBILE) {
    						mobileNumber = contact.getString(BlackBerryContact.TEL, i);
    						break;
    					}
    				}
    			}
Hope it will help u..
Offline   Reply With Quote