WakefulBroadcastReceiver nie może być rozstrzygnięty na typ
Mój projekt wyświetla komunikat o błędzieWakefulBroadcastReceiver cannot be resolved to a type
. Spojrzałem w górę ze wszystkich możliwych powodów, o których mogę pomyśleć. Mam ustaloneandroid-support-library
igoogle play services
ścieżka. Nawet mój mapView działa (jeśli komentuję poniżej kodu), co oznaczagoogle play service
jest poprawnie dodany do projektu.
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);
}
}
Jakiś pomysł, dlaczego to powoduje błąd?