Android Open Source - androidto-alerts C2 D M Broadcast Receiver






From Project

Back to project page androidto-alerts.

License

The source code is released under:

# License This license applies to all parts of this project that are not externally maintained libraries. The externally maintained libraries used by this project are: - Android C2DM Library, locat...

If you think the Android project androidto-alerts listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 *//*ww  w .  j av  a 2 s .c  o m*/
package com.google.android.c2dm;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * Helper class to handle BroadcastReciver behavior.
 * - can only run for a limited amount of time - it must start a real service 
 * for longer activity
 * - must get the power lock, must make sure it's released when all done.
 * 
 */
public class C2DMBroadcastReceiver extends BroadcastReceiver {
    
    @Override
    public final void onReceive(Context context, Intent intent) {
        // To keep things in one place.
        C2DMBaseReceiver.runIntentInService(context, intent);
        setResult(Activity.RESULT_OK, null /* data */, null /* extra */);        
    }
}




Java Source Code List

com.google.android.c2dm.C2DMBaseReceiver.java
com.google.android.c2dm.C2DMBroadcastReceiver.java
com.google.android.c2dm.C2DMessaging.java
com.rahulagarwal.android.androidtoalerts.C2DMReceiver.java
com.rahulagarwal.android.androidtoalerts.Constants.java
com.rahulagarwal.android.androidtoalerts.DeviceRegistrar.java
com.rahulagarwal.android.androidtoalerts.MainActivity.java