0
scheduleClient = new ScheduleClient(mContext);
scheduleClient.doBindService();
Calendar cal=Calendar.getInstance();
cal.setTime(date);
scheduleClient.setAlarmForNotification(cal);

I can't see where is the problem as I have initialized the object. Rhis is the error which I am getting.

java.lang.NullPointerException: Attempt to invoke virtual method 'void lol.com.epl.ScheduleService.setAlarm(java.util.Calendar)' on a null object reference
        at lol.com.epl.ScheduleClient.setAlarmForNotification(ScheduleClient.java:63)
        at lol.com.epl.FixAdapter$1.onClick(FixAdapter.java:128)

java:128 points to line

scheduleClient.setAlarmForNotification(cal);

At line 63

  public void setAlarmForNotification(Calendar c){

    mBoundService.setAlarm(c);
}

0 Answers0