GCM registration id returns empty after successfully registered
<p>I am getting an empty string for regID after the device registered with GCM server successfully.. I am getting a full regID from my GCMIntentService class after some delay. I just need it in my activity.. Can any one help me out .. Thanks .. here is the code to register my device</p>

<pre><code> private void registerDevice() {

    GCMRegistrar.checkDevice(this);
    GCMRegistrar.checkManifest(this);

    if (GCMRegistrar.isRegistered(this)) {
        Log.d("info", GCMRegistrar.getRegistrationId(this));
    }
     regID = GCMRegistrar.getRegistrationId(this);

    if (regID.equals("")) {
        GCMRegistrar.register(this, APIConfig.SENDER_ID);
        regID = GCMRegistrar.getRegistrationId(this);
    } else {
        Log.d("info", "already registered as" + regID);
    }

}
</code></pre>
