use of ve.com.abicelis.remindy.model.Task in project Remindy by abicelis.
the class HomeListFragment method updateViewholderItem.
/* Called from HomeActivity.onActivityResult() */
public void updateViewholderItem(int position) {
//Task was edited, refresh task info and refresh recycler
try {
Task task = mDao.getTask(mTasks.get(position).getTask().getId());
TaskViewModel taskViewModel = new TaskViewModel(task, ConversionUtil.taskReminderTypeToTaskViewmodelType(task.getReminderType()));
mTasks.set(position, taskViewModel);
mAdapter.notifyItemChanged(position);
} catch (CouldNotGetDataException e) {
SnackbarUtil.showSnackbar(mRecyclerView, SnackbarUtil.SnackbarType.ERROR, R.string.error_problem_updating_task_from_database, SnackbarUtil.SnackbarDuration.LONG, null);
}
}
Aggregations