取消注册c2dm

时间:2012-03-20 10:54:34

标签: java android android-intent android-c2dm android-2.2-froyo

我正试图取消注册c2dm,因为他点击了我的取消注册按钮

public void unregister (View view) {
    Log.w("C2DM", "start unregister process");
    Intent unregIntent = new Intent("com.google.android.c2dm.intent.UNREGISTER");
    unregIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0));
    startService(unregIntent);
}

在logcat中,它显示我的Log.w已被命中,因为它表示启动取消注册过程但是我仍然可以从我的服务器接收消息。 我注意到的另一件事是在Log.w之后的logcat中它再次启动注册过程。来自我寄存器母猪的所有日志,我也得到一个http响应显示和插入语句。

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

你没有设置Intent的包 - 不确定这是否会导致错误。应该是:

com.google.android.gsf
相关问题