From 30124d1a97835bc7bbafbbd2a81b076ce9bddaa3 Mon Sep 17 00:00:00 2001 From: costin Date: Wed, 6 Oct 2010 00:35:45 +0000 Subject: [PATCH] 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. --- .../src/com/google/android/apps/chrometophone/MainActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/com/google/android/apps/chrometophone/MainActivity.java b/android/src/com/google/android/apps/chrometophone/MainActivity.java index 2ca2228..b80e9c0 100644 --- a/android/src/com/google/android/apps/chrometophone/MainActivity.java +++ b/android/src/com/google/android/apps/chrometophone/MainActivity.java @@ -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);