If I have got your question right, for your app to app method. You can store
the first time value or I'd as a shared prefrences. In your second device.
So if your second device gets a new or different I'd. You can stop the
receive in device 2. (P.S you can set an auto incremental is for this)
On Oct 21, 2011 5:01 PM, "ntt broken" <nttbro...@gmail.com> wrote:
>
> Hi,
>
> i wrote a simple android app that is auto reply.
> i want this to happen only once:
> device #1 -> send sms -> device#2
> device#1 <- auto reply text <- device#2
>
> the problem is that instead of answering with SMS only once, there's a
loop that never ends of replying SMS to the device that sent the first
message.
>
> how can i handle it or tell it to stop after once?
> is there an event i need to keep my mind on? a code i need to add that
close this thing? a flag or attribute i need to change?
>
> in the activity i only show hello world text.
> i have another file with BroadcastReceiver that gets the incoming SMS:
> public class SMSReceiver extends BroadcastReceiver
> and my relevant code is in the OnReceive() method:
> SmsManager sms = SmsManager.getDefault();
> sms.sendTextMessage(sender, null, answer, null, null);
>
> Br0k3n.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to