Replace GCM and polling with long polling
[fonbot.git] / src / ro / ieval / fonbot / ProtectedBroadcastReceiver.java
index 17f99f09f7524da0cfbc32eb98524a62b97a8cea..7ad1537192d3c679526f2824b4124963833d2784 100644 (file)
@@ -10,6 +10,7 @@ import ro.ieval.fonbot.Utils.MessageType;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
+import android.net.ConnectivityManager;
 
 /*
  * Copyright © 2013 Marius Gavrilescu
@@ -54,7 +55,8 @@ public final class ProtectedBroadcastReceiver extends BroadcastReceiver {
                } else if(action.equals(Intent.ACTION_BOOT_COMPLETED)){
                        Utils.sendMessage(context, toNonNull(MessageType.BOOT),
                                                          toNonNull(context.getString(device_booted)));
-               }
+               } else if(action.equals(ConnectivityManager.CONNECTIVITY_ACTION))
+                       context.startService(new Intent(context, FonBotMainService.class));
        }
 
 }
This page took 0.009445 seconds and 4 git commands to generate.