package com.samples.alarm.alarmmanager;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.widget.Toast;

public class AlarmService extends Service {
    
	private int count;
	
	@Override
	public void onCreate() {
		count = 0;
		Toast.makeText(this, "Create service", 
				Toast.LENGTH_LONG).show();
	}
	
	@Override
	public IBinder onBind(Intent intent) {
		Toast.makeText(this, "Bind service", 
				Toast.LENGTH_LONG).show();
		return null;
	}
	
	@Override
	public void onDestroy() {
		super.onDestroy();
		Toast.makeText(this, "Destroy service", 
				Toast.LENGTH_LONG).show();
	}
	
	@Override
	public void onStart(Intent intent, int startId) {
		super.onStart(intent, startId);
		count++;
		Toast.makeText(this, "Notify from AlarmManager #" + count, 
				Toast.LENGTH_LONG).show();
	}
	
	@Override
	public boolean onUnbind(Intent intent) {
		Toast.makeText(this, "Unbind service", 
				Toast.LENGTH_LONG).show();
		return super.onUnbind(intent);
	} 
}