【问题标题】:unregister c2dm注销c2dm
【发布时间】:2012-03-20 10:54:34
【问题描述】:

我正在尝试取消注册 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 响应。

任何帮助将不胜感激。

【问题讨论】:

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


    【解决方案1】:

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

    com.google.android.gsf
    

    【讨论】:

    • unregIntent.setPackage(..) ;)
    • 不幸的是,这不是答案:(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多