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
Developer
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

get address of specific sms after select

hi All

 

how i can get address of specific sms after select?

 

regards

savi

Developer
Posts: 16,643
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: get address of specific sms after select

what do you mean with select? in the message window on the blackberry you could only retrieve it using an applicationmenuitem and its context.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: get address of specific sms after select

TextMessage sms

String phoneNumber = sms.getAddress();

Developer
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: get address of specific sms after select

how i can reterive it using applicationmenuitem?

 

i have added one menu in custom menus.if i select specific sms and click on my added menu then address of that sms should come...can you guide me?

 

savi

Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: get address of specific sms after select

public class smsMenu extends ApplicationMenuItem{

    public MessageMenuItem(int order)
    {
        super(order);
    }

   public Object run(Object context)
  {
        if(context instanceof TextMessage){

        TextMessage sms = (TextMessage)context;
        String phoneNumber = sms.getAddress();
        String Body = sms.getPayloadText();
         Date receivedDate = sms.getTimestamp();

  }

}

Developer
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: get address of specific sms after select

hi.....

 

this is code is working but how i can check in simulator?can you tell me any idea?

how i can check through  simulator?

 

savi

Developer
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: get address of specific sms after select

 

 

thanks you , finally i got it..

 

 

kudos for you :smileyhappy:

 

savi