Skip to content

Instantly share code, notes, and snippets.

@ashutoshpw
Created May 7, 2018 06:25
Show Gist options
  • Save ashutoshpw/039bcf24364f76d4f0896d1ad574c9e4 to your computer and use it in GitHub Desktop.
Save ashutoshpw/039bcf24364f76d4f0896d1ad574c9e4 to your computer and use it in GitHub Desktop.
Android Broadcast receiver
<receiver android:name="MyReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// assumes WordService is a registered service
// Your Action Here
//Intent intent = new Intent(context, WordService.class);
//context.startService(intent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment