Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
Posts: 158
Registered: ‎03-09-2010
My Device: 8900
My Carrier: developer
Accepted Solution

Regarding dilag.ask

hi

 

 

I want to send the msg to other number . I want that ,with dialog.ask()..  I had select the phone number from BlackberryContact.TEL .

 

 I had to choose the number from attr_work,attr_work2,attr_home,attr_home2,attr_mobile with dialog.ask ().

 

How should i do it  that ?

 

please help .

 

Thanks and regards

Amrinder singh

Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Regarding dilag.ask

How about:

 

String [] places = { "Work", "Work 2", "Home", "Home 2", "Mobile" };
int where = Dialog.ask("Send To", places, 0);
if (where != Dialog.CANCEL) {
// send message to places[where]
}



Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Trusted Contributor
Posts: 158
Registered: ‎03-09-2010
My Device: 8900
My Carrier: developer

Re: Regarding dilag.ask

hi ,

 

 

one more question

 

i got the list ,but how could i select one of them from all these

 { "Work", "Work 2", "Home", "Home 2", "Mobile" }; numbers

 

please suggest sir

 

Thanks and regards

Amrinder singh

Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Regarding dilag.ask

I don't understand the question. Do you mean how do you extract the desired phone number from a BlackBerryContact object after the user answers the Dialog? You need to translate the selected index into an attribute index. So, for instance, you can define an array

int[] atts = { Contact.ATTR_WORK, /* etc. */ };

The order of the array elements must match the order of the names in the places array. Then you can use

int tel = contact.getAttributes(Contact.TEL, atts[where]);

(where "where" is the return value from Dialog.ask) to retrieve the desired info.




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.