package com.example.andy.myapplication;

import android.app.IntentService;
import android.content.Intent;
import android.os.IBinder;

public class service extends IntentService {
    public static volatile boolean shouldStop = false;
    public service() {
        super(service.class.getSimpleName());
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        Intent intent1 = new Intent();
        intent1.setAction("com.example.andy.myapplication");
        intent1.putExtra("DATAPASSED", "Tutorialspoint.com");
        sendBroadcast(intent1);
        if(shouldStop){
            stopSelf();
            return;
        }
    }
}
