SERVICE_NOT_AVAILABLE无法在Android 2.2上启动服务Intent

时间:2014-11-12 05:05:36

标签: android android-intent

我的应用程序在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;
    }

有人对此有所了解吗?

0 个答案:

没有答案