onResume() can be called for various reasons ( task switch, etc ). Make sure the registration was received to avoid "Missing registration id".

This is not a complete fix - we should avoid making registration requests when one is already in progress.
This commit is contained in:
costin
2010-10-06 00:35:45 +00:00
parent c24fa2c027
commit 30124d1a97

View File

@@ -77,7 +77,7 @@ public class MainActivity extends Activity {
if (mPendingAuth) {
mPendingAuth = false;
String regId = C2DMessaging.getRegistrationId(this);
if (regId != null) {
if (regId != null && !"".equals(regId)) {
DeviceRegistrar.registerWithServer(this, regId);
} else {
C2DMessaging.register(this, DeviceRegistrar.SENDER_ID);