Something went wrong on our end
-
Peter Joseph De Jonckheere CESM2014 authored
Further attempts to fix spinner. Narrowed error down to null pointer at setAdapter line either spinner or adapter is null but on debug inspection this doesn't appear to be the case.
Peter Joseph De Jonckheere CESM2014 authoredFurther attempts to fix spinner. Narrowed error down to null pointer at setAdapter line either spinner or adapter is null but on debug inspection this doesn't appear to be the case.
Clock.java 1.10 KiB
package com.example.stimulusStrategy;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.util.Log;
import com.example.notification.Notification;
/**
* Created by pharmacy on 09/01/2018.
*/
public class Clock extends Service implements StimulusStrategy {
@Override
public void onCreate(){
monitor();
}
public void monitor() {
//Does intent require parameters??
//Similar for pending intent??
//Intent should also be configured here to set up notification properly
AlarmManager am = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(this, Notification.class);
PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, 0);
am.set(AlarmManager.ELAPSED_REALTIME, AlarmManager.INTERVAL_FIFTEEN_MINUTES, pi);
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
}