@Override protected List<String> doInBackground(Void... arg0) { try { List<String> result = new ArrayList<String>(); com.google.api.services.tasks.Tasks.TasksOperations.List listRequest = service.tasks().list("@default"); listRequest.setFields("items/title,items/notes,items/completed"); //listRequest.setFields("items/title"); List<Task> tasks = listRequest.execute().getItems(); if (tasks != null) { for (Task task : tasks) { result.add(task.getTitle()); } } else { result.add("No tasks."); } return result; } catch (IOException e) { tasksSample.handleGoogleException(e); return Collections.singletonList(e.getMessage()); } finally { tasksSample.onRequestCompleted(); }
private void showTaskList(PrintWriter writer) { writer.println("<h1>Tasks</h1>"); Collection<Task> tasks = taskService.getTasks(); for (Task task : tasks) { writer.println("<a href=\"?taskId=" + task.getId() + "\">" + task.getTitle() + "</a><BR/>"); } }
for (Task tempTask : tasksRepository) { LatLng latlng = new LatLng(tempTask.getLatitude(), tempTask.getLongtitude()); newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_blue))); }
private void showTask(PrintWriter writer, String taskId) { SimpleDateFormat sdf = new SimpleDateFormat(); Task task = taskService.getTask(taskId); if (task != null) { writer.println("<h1>Task " + task.getTitle() + " </h1>"); if (task.getDueDate() != null) { writer.println("Due date: " + sdf.format(task.getDueDate()) + "<br/>"); } writer.println(task.getDescription()); } else { writer.println("Task with id " + taskId + " not found"); } }
for (Task tempTask : TasksListAppObj.getInstance().tasksRepository.getTasksRepository()) { LatLng latlng = new LatLng(tempTask.getLatitude(), tempTask.getLongtitude()); if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_WAITING)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_blue))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_IN_PROGRESS)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_bordo))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_ON_THE_WAY)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_turkiz))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_COMPLETE)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_orange))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_FAILED)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_purpul))); } }
for (Task tempTask : TasksListAppObj.getInstance().tasksRepository.getTasksRepository()) { LatLng latlng = new LatLng(tempTask.getLatitude(), tempTask.getLongtitude()); if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_WAITING)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_blue))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_IN_PROGRESS)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_bordo))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_ON_THE_WAY)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_turkiz))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_COMPLETE)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_orange))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_FAILED)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_purpul))); } }
for (Task tempTask : SGTasksListAppObj.getInstance().tasksRepository.getTasksRepository()) { LatLng latlng = new LatLng(tempTask.getLatitude(),tempTask.getLongtitude()); if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_WAITING)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_blue))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_IN_PROGRESS)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_bordo))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_ON_THE_WAY)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_turkiz))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_COMPLETE)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_orange))); } else if (tempTask.getStatus().contentEquals(TasksListActivity.STATUS_FAILED)) { newmarker = map.addMarker(new MarkerOptions().position(latlng).title(tempTask.getTitle()).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_for_map_purpul))); } }
RelativeLayout rl = (RelativeLayout) findViewById(R.id.relativeLayout3); final DatabaseHandler dbpin = new DatabaseHandler(this); Log.d("Reading: ", "Reading all tasks.."); List<Task> task1 = dbpin.getAllTask(); for (Task cn : task1) { String log = cn.getTitle(); int i = cn.getID(); Button button = new Button(this); button.setText("View" + i); button.setTextSize(10); button.setId(2000 + i); int width = 80; int height = 60; TextView textview = new TextView(this); textview.setText(log); textview.setWidth(200); textview.setTextSize(20); textview.setPadding( 0, 10, 0, 0); textview.setId(2000 + i); }
public void list() throws Exception { ShellTable table = new ShellTable(); table.column("id"); table.column("title"); for (Task task : taskService.getTasks()) { table.addRow().addContent(task.getId(), task.getTitle()); } table.print(System.out); } }