12.09.2010 0:37, tony obrien пишет:
Well, that was a bust ...

I am pretty sure that*my*  BR is not getting called... pls check my
work::

This is the Manifest =>  (assume the correct permissions in that I do
get the SMS when this is working in the foreground)

         <receiver android:name=".clsSMSRCV">
             <intent-filter>
                 <action
android:name="android.provider.Telephony.SMS_RECEIVED" />
             </intent-filter>
         </receiver>

Looks good. Assuming that your tags are nested correctly (<receiver> should be inside <application>), and that you also have this at the end of the manifest, inside <manifest>:

<uses-permission android:name="android.permission.RECEIVE_SMS"/>
My MAINACTIVITY declares the BR as so...

       private clsSMSRCV myClsSMSRCV;

and then in the MainActivity.onCreate() ==

      myClsSMSRCV = new clsSMSRCV();

No need to do this - Android will instantiate your receiver as necessary, and call its onReceive().
This is the clsSMSRCV definition with the receive override:

public class clsSMSRCV extends BroadcastReceiver {

     @Override
     public void onReceive(Context context, Intent intent) {
      // I tear apart the SMS message(s) here... and alter Statics for
review outside this routine
     }
}
Have you tried logging this?

Just a simple

    Log.i("clsSMSRCV", "Inside onReceive")

would be immensely helpful.

One last thing, I can think of...

Main has a runnable which is essentially monitoring the Statics and so
can then act upon them changing in ClsSMSRCV.

In my last experiment I had the onReceive() try to express a
Notification.... nuttin happened.

Polling for events is bad - it ties the CPU, uses up the battery, and doesn't work when the phone is asleep. You could broadcast an intent with your own action string to notify other components of your application.

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
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