Android : Android GCM IntentService loop "doing some work"?

on Saturday, September 20, 2014


I am using Google Cloud Messaging in an Android app and I was wondering what is the purpose of this part of the code in the IntentService, once the GCM message has been received and before processing:



// This loop represents the service doing some work.
for (int i = 0; i < 5; i++) {
if (D) Log.i(TAG, "Working... " + (i + 1) + "/5 @ " + SystemClock.elapsedRealtime());
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
}
}


Any thoughts about it? Thanks!


0 comments:

Post a Comment