Whither GMail's PROVIDER_CHANGED intent

I have been struggling to get PROVIDER_CHANGED to fire in my receiver. I am trying to detect new GMail. I know that the undocumented access to content://gmail-ls is now closed; all I need to capture is the PROVIDER_CHANGED intent, following which I can access GMail via POP/IMAP.

I can see the Intent in DDMS, as well as in CatLog, just mystified why I can see it in my app. If CatLog can see it, I should too, yes?

Here is my manifest. I have a couple of other broadcast intents (battery low etc, not shown here) that do fire OK.

<receiver android:name=".MyReceiver">
  <intent-filter>
    <action android:name="android.intent.action.PROVIDER_CHANGED"/>
  </intent-filter>          
</receiver>

And my receiver class:

public class MyReceiver extends BroadcastReceiver
{   
    static Context context = null;
    @Override
    public void onReceive(Context ctxt, Intent intent)
    {
        context = ctxt;

        Log.d("MYAPP", intent.toString());
                    if("android.intent.action.PROVIDER_CHANGED".equals(intent.getAction()))
        {
                      ...
                    }
          }

Answers


Try to specify android:scheme for the intent filter

Here is the update:

<receiver android:name=".MyReceiver">
  <intent-filter>
    <action android:name="android.intent.action.PROVIDER_CHANGED"/>
    <data android:scheme="content" />
  </intent-filter>          
</receiver>

I think you're going about this the wrong way, take a look at the

Gmail API


Need Your Help

Facebook. Publish text on facebook wall by clicking image

php facebook api session stream

I want to make a facebook app, when user click on image auto publish some text on user's wall.

glibc not properly compiling

c linux gcc x86 glibc

While compiling glibc 2.11, I get the following error. Any idea how to solve this.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.