/** * @see SchedulerHelper#create(ObjectFactory, String) */ public static SchedulerHelper create(final LazyInitializer<Runnable> runnableFactory) { return new SchedulerHelper(runnableFactory); }
/** * @see SchedulerHelper#create(ObjectFactory, String) */ public static SchedulerHelper create(final LazyInitializer<Runnable> runnableFactory) { return new SchedulerHelper(runnableFactory); }
/** * Factory method. Creates a {@link SchedulerHelper} which consumes a factory providing a runnable. This approach * allows lazy runnable initialization. * * @param runnableFactory * a factory creating the runnable to schedule. * @param name * the name associated with this {@link SchedulerHelper} (useful to detect if this class is causing a memory * leak. */ public static SchedulerHelper create(final LazyInitializer<Runnable> runnableFactory, final String name) { return new SchedulerHelper(runnableFactory, name); }
/** * Factory method. Creates a {@link SchedulerHelper} which consumes a factory providing a runnable. This approach * allows lazy runnable initialization. * * @param runnableFactory * a factory creating the runnable to schedule. * @param name * the name associated with this {@link SchedulerHelper} (useful to detect if this class is causing a memory * leak. */ public static SchedulerHelper create(final LazyInitializer<Runnable> runnableFactory, final String name) { return new SchedulerHelper(runnableFactory, name); }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //remove setcontentview() schedulerHelper = new SchedulerHelper(this); schedulerHelper.open(); todaysTaskArrayList = new ArrayList<TodayTasks>(); todaysTaskArrayList = schedulerHelper.getTodayTasks(); if (!todaysTaskArrayList.isEmpty())//has elements Toast.makeText(getApplicationContext(), "not empty", Toast.LENGTH_SHORT) .show(); todays_task_list = getListView();//write this. customAdapter = new CustomAdapter(this, R.layout.list_row, todaysTaskArrayList); todays_task_list.setAdapter(customAdapter); todays_task_list.setOnItemClickListener(this);} @Override protected void onResume() { super.onResume(); todaysTaskArrayList = new ArrayList<TodayTasks>(); todaysTaskArrayList = schedulerHelper.getTodayTasks(); //this should be here customAdapter = new CustomAdapter(this, R.layout.list_row, todaysTaskArrayList); todays_task_list.setAdapter(customAdapter); todays_task_list.setOnItemClickListener(this); //instead of here. }