我的应用程序在android 4.x上工作得很好但是android 2.2 我尝试了GCM SERVICE_NOT_AVAILABLE on Android 2.2的所有解决方案 但仍然得到" SERVICE_NOT_AVAILABLE" 无法启动服务Intent {act = com.google.android.c2dm.intent.REGISTER pkg = com.google.android.gms(有额外内容)}
protected Void doInBackground(Void... params) {
final long timeSleep = 1000;
int count = 0;
while (count < 2) {
try {
count++;
GoogleCloudMessaging gcm = GoogleCloudMessaging
.getInstance(Context);
regid = gcm.register(Constant.SENDER_ID);
return null;
} catch (IOException e) {
e.printStackTrace();
}
try {
Log.w(TAG, "Registration failed. Retrying in " + timeSleep + " ms.");
Thread.sleep(timeSleep);
} catch (InterruptedException e) {
}
}
return null;
}
有人对此有所了解吗?