Code example for Intent

Methods: getService

0
	private PendingIntent alarm_sender;
 
	@Override 
	public void onCreate() { 
		super.onCreate(); 
		alarm_sender = PendingIntent.getService(AlarmHostService.this, 0, new Intent(AlarmHostService.this, AlarmService.class), 0);
	} 
 
	@Override 
	public void onStart(Intent intent, int startId) {
		super.onStart(intent, startId);
		 
		SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(this);
 
		AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
 
		//Set the alarm time 
 		String time = app_preferences.getString("timeAutoDownload", "2:0");
 		GregorianCalendar currentCalendar = new GregorianCalendar();
 		long alarmTime = new GregorianCalendar(