我的项目显示错误消息WakefulBroadcastReceiver cannot be resolved to a type.我抬头看看我能想到的所有可能的原因.我已android-support-library和google play services的路径.即使我的mapView工作(如果我在代码下面注释),这意味着google play service正确地添加到项目中.
public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// Explicitly specify that GcmIntentService will handle the intent.
ComponentName comp = new ComponentName(context.getPackageName(),
GcmIntentService.class.getName());
// Start the service, keeping the device awake while it is launching.
startWakefulService(context, (intent.setComponent(comp)));
setResultCode(Activity.RESULT_OK);
}
}
Run Code Online (Sandbox Code Playgroud)
知道为什么会出错吗?