Created
January 20, 2016 04:09
-
-
Save a1yama/a2607e66a2d391a6abc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.support.v4.content.WakefulBroadcastReceiver; | |
public class GcmBroadcastReceiver extends WakefulBroadcastReceiver { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
// Serviceの起動 | |
ComponentName comp = | |
new ComponentName(context.getPackageName(), GcmIntentService.class.getName()); | |
startWakefulService(context, (intent.setComponent(comp))); | |
setResultCode(Activity.RESULT_OK); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment