[英]Whither GMail's PROVIDER_CHANGED intent
I have been struggling to get PROVIDER_CHANGED to fire in my receiver. 我一直在努力让PROVIDER_CHANGED在我的接收器中开火。 I am trying to detect new GMail.
我正在尝试检测新的GMail。 I know that the undocumented access to content://gmail-ls is now closed;
我知道对content:// gmail-ls的无证访问现已关闭; all I need to capture is the PROVIDER_CHANGED intent, following which I can access GMail via POP/IMAP.
我需要捕获的只是PROVIDER_CHANGED意图,之后我可以通过POP / IMAP访问GMail。
I can see the Intent in DDMS, as well as in CatLog, just mystified why I can see it in my app. 我可以在DDMS和CatLog中看到Intent,这只是为什么我可以在我的应用程序中看到它的原因。 If CatLog can see it, I should too, yes?
如果CatLog可以看到它,我也应该知道吗?
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()))
{
...
}
}
Try to specify android:scheme for the intent filter 尝试为意图过滤器指定android:scheme
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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.