0

我按照这个主题http://developer.android.com/guide/google/gcm/gs.html#libs 创建 GCM 我做了所有步骤都很好但是当我继续创建类 GCMIntenetService 时我在类上遇到了更多错误错误“无法解析到类型”,“方法的返回类型丢失......”......请如果有人帮忙。

包 com.example.elarabygroup;

公共类 GCMIntenetService 扩展 GCMBaseIntentService {

private static final String LOG_TAG = "GetAClue::GCMIntentService";

public GCMIntentService() {
    super( GCM_SENDER_ID );
    // TODO Auto-generated constructor stub
    Log.i( LOG_TAG, "GCMIntentService constructor called" );
}

@Override
protected void onError( Context arg0, String errorId ) {
    // TODO Auto-generated method stub
    Log.i( LOG_TAG, "GCMIntentService onError called: " + errorId );
}

@Override
protected void onMessage( Context arg0, Intent intent ) {
    // TODO Auto-generated method stub
    Log.i( LOG_TAG, "GCMIntentService onMessage called" );
    Log.i( LOG_TAG, "Message is: " + intent.getStringExtra( "message" ) );
}

@Override
protected void onRegistered( Context arg0, String registrationId ) {
    // TODO Auto-generated method stub
    Log.i( LOG_TAG, "GCMIntentService onRegistered called" );
    Log.i( LOG_TAG, "Registration id is: " + registrationId );
}

@Override
protected void onUnregistered( Context arg0, String registrationId ) {
    // TODO Auto-generated method stub
    Log.i( LOG_TAG, "GCMIntentService onUnregistered called" );
    Log.i( LOG_TAG, "Registration id is: " + registrationId );
}

}

4

1 回答 1

0

谢谢我已经解决了我的问题,因为我没有添加任何命名空间:

import com.google.android.gcm.GCMBaseIntentService;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
于 2012-09-05T09:23:33.110 回答