Running Send_SMS method from BroadcastReceiver

Posted by burmat on Stack Overflow See other posts from Stack Overflow or by burmat
Published on 2011-01-08T17:53:07Z Indexed on 2011/01/08 17:53 UTC
Read the original article Hit count: 260

Filed under:

My application is an auto-reply application for text messages. I have a BroadcastReceiver for when a message arrives, and I need it to run a public method (Send_SMS).

            SMS_Sender.sendSMS(phoneNumber, messageText);

does not work however, and eclipse wants to change my method to static. This would not be an issue if I did not have more receivers that catch when the message is sent/delivered/etc in this class. These receivers are then errors for being contained in a static method.

So my question is, how do I run this method from a broadcast receiver so I can send the auto reply whenever it is triggered with a received message?

-Thank you in advance, Nate

© Stack Overflow or respective owner

Related posts about android