View Single Post
Old 09-17-2009, 07:57 AM   #15
vivartpandey
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 9000
Carrier: Airtel
Posts: 81
Default

use this run() method
public Object run(Object context) {

if (context == null) {
return null;
}

if (!(context instanceof BlackBerryContact)) {
return null;
}

BlackBerryContact c = (BlackBerryContact)context;
if (c != null) {
int numValues = 0;
String contactnames = new String();;
try {
numValues = c.countValues(BlackBerryContact.TEL);
contactnames = new String();
} catch (Exception e) {
}
for (int i = 0; i < numValues; i++) {
if (c.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_WORK) {
contactnames = c.getString(BlackBerryContact.TEL, i);
} else if (c.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_HOME) {
contactnames = c.getString(BlackBerryContact.TEL, i);
} else if (c.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_MOBILE) {
contactnames = c.getString(BlackBerryContact.TEL, i);
} else if (c.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_OTHER) {
contactnames = c.getString(BlackBerryContact.TEL, i);
}
}

reciever = contactnames;
Application.getApplication().requestForeground();

// on invocation, will call the main method of this app. with
// argument as specified in addMenuItem
} else {
throw new IllegalStateException(
"Context is null, expected a textmessage instance"
+ context.toString());
}
return null;
}
__________________
blog.vimviv.com
Offline   Reply With Quote