I have been trying to catch the ACTION_PROVIDER_CHANGED intent to use
and see how many unread emails there are still left. According to the
documentation you can receive the action to these data.

Documentation:
Broadcast Action: Some content providers have parts of their namespace
where they publish new events or items that the user may be especially
interested in. For these things, they may broadcast this action when
the set of interesting items change. For example, GmailProvider sends
this notification when the set of unread mail in the inbox changes.

But somehow my catching code is never hit, when i replace the Intent
Action with something like ACTION_TIME_TICK or another one, it works
perfectly, but this one never seems to hit.

I know the intent is being broadcasted looking at the LogCat, but i am
still never able to receive it.

06-20 15:35:52.726: INFO/gmail-ls(130): Sending notification intent:
Intent { action=android.intent.action.PROVIDER_CHANGED data=content://
gmail-ls/unread/^i type=gmail-ls (has extras) }


Has anyone had this same problem or has found a work around?

The (partial) code i am using is as followed:

        @Override
        public void onStart(Intent intent, int startId) {
            // Build the widget update for today
                Log.i("GMAILNOT", "Service started");

            registerReceiver(mGmailNotInfoReceiver, new IntentFilter
(Intent.ACTION_PROVIDER_CHANGED));
        }

        private BroadcastReceiver mGmailNotInfoReceiver = new
BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {

                Log.i("GMAILNOT", intent.toString());

                 String action = intent.getAction();
                 if (Intent.ACTION_PROVIDER_CHANGED.equals(action)) {
                     Uri dataURI= intent.getData();
                     String dataURIPath=dataURI.getPath();
                     Log.i("GMAILNOT", dataURIPath);
                 }
            }
       };

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