2
我使用C2DM,如果注册成功,它工作正常。但有时注册失败,然后尝试以后注册:C2DM注册重试
Intent retryIntent = new Intent(C2DM_RETRY);
PendingIntent retryPIntent = PendingIntent.getBroadcast(context,
0 /*requestCode*/, retryIntent, 0 /*flags*/);
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
am.set(AlarmManager.ELAPSED_REALTIME,
backoffTimeMs, retryPIntent);
但是,如果警报管理器触发此意图该怎么办?我必须抓住它吗?因为不知何故程序从未重新注册。
感谢您的回答。它帮助了我很多,但我得到一个错误Permission Denial:从my.package.name(pid = -1,广播意图){act = com.google.android.c2dm.intent.RETRY flg = 0x4(有额外) uid = 10041)需要com.google.android.c2dm.permission.SEND,因为接收者my.package.name/com.google.android.c2dm.C2DMBroadcastReceiver - 如果您可以扩展您的答案以包含所需内容为解决这个问题提供一个完整的答案。再次感谢 – jamesc 2011-10-13 16:01:19