GCMIntentService が呼び出されると問題が発生し、例外がスローされます。
java.lang.ClassCastException: com.test.test.GCMIntentService を android.content.BroadcastReceiver にキャストできません
ただし、私のクラスは GCMBaseIntentService を拡張します。実際、私のコンストラクトはうまく「終了」し (super(SENDER_ID); は問題なく渡されます)、コンストラクターを終了するときに問題が発生します。内部クラスが新しく作成されたインスタンスをキャストしようとすると、疑わしい私の拡張クラスの。
必要に応じて参照用のコード:
package com.adk.test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import android.app.Notification;
import android.os.Bundle;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationCompat.Builder;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import utilities.Logd;
import com.google.android.gcm.GCMBaseIntentService;
import com.google.android.gcm.GCMConstants;
import com.google.android.gcm.GCMRegistrar;
public class GCMIntentService extends GCMBaseIntentService {
    private final String LOG_TAG = "Test";
    private final static String senderID = "66610078X85X";
    public GCMIntentService(){
        super("66610078X85X");
        Logd.i(LOG_TAG, "GCM passed");
    }
    @Override
    protected void onError(Context arg0, String errorID) {
        Logd.e(LOG_TAG, errorID, null);
    }
    @Override
    protected void onMessage(Context arg0, Intent intent) {
        enviarNotificacion(arg0, intent);
    }
    @Override
    protected void onRegistered(Context arg0, String deviceID) {
        Registrar(arg0, deviceID);      
        Logd.i(LOG_TAG, "Registered");
    }
    @Override
    protected void onUnregistered(Context arg0, String arg1) {
        Logd.i(LOG_TAG, "Unregistered");
    }
}