X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fro%2Fieval%2Ffonbot%2FGCMIntentService.java;h=84a3c7903268c8656f3790dd406db5712000260f;hb=6b9507db27500572e4366b3f23eefeea079a9d8f;hp=de3820874242db746df6a281c2a2079e550997e0;hpb=8dfb76c9431dbf8401412cb92c7512e7dc3081a2;p=fonbot.git diff --git a/src/ro/ieval/fonbot/GCMIntentService.java b/src/ro/ieval/fonbot/GCMIntentService.java index de38208..84a3c79 100644 --- a/src/ro/ieval/fonbot/GCMIntentService.java +++ b/src/ro/ieval/fonbot/GCMIntentService.java @@ -4,9 +4,6 @@ import org.eclipse.jdt.annotation.Nullable; import android.content.Context; import android.content.Intent; -import android.os.Handler; -import android.os.Looper; - import com.google.android.gcm.GCMBaseIntentService; /* @@ -34,9 +31,6 @@ import com.google.android.gcm.GCMBaseIntentService; * @author Marius Gavrilescu */ public class GCMIntentService extends GCMBaseIntentService { - /** Handler instance */ - private final Handler handler=new Handler(Looper.getMainLooper()); - /** * Constructs a GCMIntentService with the iEval sender id */ @@ -51,17 +45,15 @@ public class GCMIntentService extends GCMBaseIntentService { @Override protected void onMessage(@Nullable final Context context, @Nullable final Intent intent) { - handler.post(new Runnable(){ - @Override - public void run() { - new PollServerAsyncTask().execute(); - } - }); + if(context==null) + return; + + Utils.pollServer(context); } @Override protected void onRegistered(@Nullable final Context context, @Nullable final String regID) { - FonBotApplication.instance.regID=regID; + //do nothing } @Override