Receiver dynamically or in manifest?

by Manfred » Thu, 05 Mar 2009 20:50:23 GMT


Sponsored Links
 Hi!

I have dynamically registered a receiver in a class that extends
Service to inform for incoming sms.

Code:
this.registerReceiver(smslistener, new IntentFilter
("android.provider.Telephony.SMS_RECEIVED"));

It works, but sometimes, when the phone is longer not used and the
black-screen appears, my application does not notice incoming sms
until i use the phone again.
So for example, i sent a sms at 13:23 and the G1 got it also at 13:23
but in the Logfile the entry was made at 13:43 when i used the phone
again.

I read in another article that its better for listening to incoming
sms to register the receiver not dynamically but in the manifest, then
it should work! But my problem is, if i register it in the manifest it
is running when the application starts, but i want that the user can
choose if incoming sms would be noticed.

So is there a way to register the receiver in manifest, but stop it
then dynamically and start it again? Or how could this be done??

Thanks
manfred
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Google Voice Call Forwarding Question

Just signed up for Google Voice, got my own Google number.  Very
simple question but I couldn't find an answer online.  I added my work
and mobile number to Voice.  Can I set it up so that when someone
calls my work number, if I do not pick up, it forwards to my mobile?
I am thinking I can not do that...

-- 

2. How to start google maps with directions.

I am new as an android developer.
I knew the URI setting "geo:latitude,longitude". But here are no
parameters for directions to set.
Does anyone know how to start google maps with directions by using
Intent?
Thanks.

-- 

3. SQLite transactions when using ContentResolver

4. How can I align an ImageView to the right of the Parent?

5. interpolatedTime in applyTransformation method

6. CheckoutCheck Open-Sourced

7. Easiest way to programmatically check if the Market app is installed?