2012-03-20 69 views
0

我試圖witht他對我的註銷按鈕的onclick以下注銷C2DM註銷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

您沒有設置Intent的包 - 不確定是否會導致錯誤。應該是:

com.google.android.gsf 
+0

unregIntent.setPackage(..);) – Tim 2012-03-20 11:24:30

+0

com.google.android.gsf不能被解析爲一個類型 – 2012-03-20 11:29:08

+0

這是一個字符串;) – Tim 2012-03-20 11:40:25