Created
January 10, 2018 09:54
-
-
Save wangerekaharun/9e263c324cc84a440f98f14e1509a0bf to your computer and use it in GitHub Desktop.
Starting the intentservice in the OnReceive method of the ToastBroadcastReceiver
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
public class ToastBroadcastReceiver extends BroadcastReceiver { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
Intent serviceIntent= new Intent(context,BackgroundService.class); | |
context.startService(serviceIntent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment